On OS X using gcc 4.0.1 the latest SVN breaks with template issues
./ui/dialog/panel-dialog.h:124: error: template-id 'create<>' for 'Inkscape::UI::Dialog::PanelDialog<Inkscape::UI::Dialog::Behavior::Float ingBehavior>* Inkscape::UI::Dialog::PanelDialog<Inkscape::UI::Dialog::Behavior::Floati ngBehavior>::create()' does not match any template declaration
I tried to look into this, but haven't found a fix so far.
On Fri, 7 Dec 2007 09:50:57 -0800 "Jon A. Cruz" <jon@...18...> wrote:
On OS X using gcc 4.0.1 the latest SVN breaks with template issues
./ui/dialog/panel-dialog.h:124: error: template-id 'create<>' for 'Inkscape::UI::Dialog::PanelDialog<Inkscape::UI::Dialog::Behavior::Float ingBehavior>* Inkscape::UI::Dialog::PanelDialog<Inkscape::UI::Dialog::Behavior::Floati ngBehavior>::create()' does not match any template declaration
Auch... sorry for that, I use 4.1.3 and for me it compiles fine. I'm pretty sure it's valid C++ -- here's a minimal test case on what I think it chokes on (tried with success in gcc 4.1 and Comeau):
-------------------------------------------------
#include <iostream>
template<class T> class X { public: template <typename T2> static void f(); };
template <typename T> template <typename T2> void X<T>::f() { std::cerr << "T" << std::endl; }
template <> template <typename T2> void X<float>::f() { std::cerr << "float" << std::endl; }
int main() { X<char *> a; X<float> b; a.f<void>(); b.f<void>(); }
-------------------------------------------------
Does that compile for you using your gcc 4.0.1?
Here's a quick and dirty attempt of rewriting the classes to avoid this type of specialization, could you please see if it compiles with it?
http://www.csc.kth.se/~broberg/inkscape_compile_problems_2007-12-08.patch
Thanks, and sorry...
-- Gustav
On Dec 7, 2007, at 5:23 PM, Gustav Broberg wrote:
Auch... sorry for that, I use 4.1.3 and for me it compiles fine. I'm pretty sure it's valid C++ -- here's a minimal test case on what I think it chokes on (tried with success in gcc 4.1 and Comeau):
#include <iostream>
template<class T> class X { public: template <typename T2> static void f(); };
template <typename T> template <typename T2> void X<T>::f() { std::cerr << "T" << std::endl; }
template <> template <typename T2> void X<float>::f() { std::cerr << "float" << std::endl; }
int main() { X<char *> a; X<float> b; a.f<void>(); b.f<void>(); }
That dies a horrible death also
g++ -o test test.cpp test.cpp:13: error: template-id 'f<>' for 'void X<float>::f()' does not match any template declaration test.cpp:13: error: invalid function declaration
On Dec 7, 2007 7:22 PM, Jon A. Cruz <jon@...18...> wrote:
On Dec 7, 2007, at 5:23 PM, Gustav Broberg wrote:
Auch... sorry for that, I use 4.1.3 and for me it compiles fine. I'm pretty sure it's valid C++ -- here's a minimal test case on what I think it chokes on (tried with success in gcc 4.1 and Comeau):
...
That dies a horrible death also
g++ -o test test.cpp test.cpp:13: error: template-id 'f<>' for 'void X<float>::f()' does not match any template declaration test.cpp:13: error: invalid function declaration
FYI, it dies on OS X 10.3.9 (gcc 3.3) also with almost the same error:
g++ -o test test.cpp test.cpp:13: error: template-id `f<>' for `void X<float>::f()' does not match any template declaration test.cpp:13: error: syntax error before `{' token
, John
On Dec 7, 2007, at 5:23 PM, Gustav Broberg wrote:
Here's a quick and dirty attempt of rewriting the classes to avoid this type of specialization, could you please see if it compiles with it?
http://www.csc.kth.se/~broberg/ inkscape_compile_problems_2007-12-08.patch
Thanks, that fixed things nicely.
I did a minor cleanup and committed it.
participants (3)
-
Gustav Broberg
-
John Faith
-
Jon A. Cruz