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

Reply via email to