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