[Bug c++/36002] New: Error messages report wrong, invalid function type.
gcc-bugzilla at contacts dot eelis dot net
gcc-bugzilla@gcc.gnu.org
Mon Apr 21 21:08:00 GMT 2008
Consider the following invalid code:
template <typename T> void f() { T::bla; }
void g() { f<void ()>(); }
g++ emits:
t.cpp: In function âÂÂvoid f() [with T = void ()()]âÂÂ:
t.cpp:2: instantiated from here
t.cpp:1: error: âÂÂblaâ is not a member of âÂÂvoid ()()âÂÂ
The error should say "void ()", not "void ()()". The latter is not even a valid
C++ type, as can be seen by doing:
template <typename T> void f();
void g() { f<void()()>(); }
resulting in:
error: âÂÂtype nameâ declared as function returning a function
--
Summary: Error messages report wrong, invalid function type.
Product: gcc
Version: 4.4.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: gcc-bugzilla at contacts dot eelis dot net
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36002
More information about the Gcc-bugs
mailing list