[Bug c++/79493] Bad diagnostic when referring to inner type that does not exist

redi at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Mon Feb 13 18:01:00 GMT 2017


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79493

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |diagnostic
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2017-02-13
     Ever confirmed|0                           |1

--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> ---
namespace A { }
struct B {
  void f(A::nonexistent param);
  void* g(A::nonexistent param);
};

For f we get a much better error, but the ptr-declarator on g confuses things:

p.cc:3:13: error: ‘A::nonexistent’ has not been declared
   void f(A::nonexistent param);
             ^~~~~~~~~~~
p.cc:4:9: error: expected ‘;’ at end of member declaration
   void* g(A::nonexistent param);
         ^
p.cc:4:26: error: expected ‘)’ before ‘param’
   void* g(A::nonexistent param);
                          ^~~~~


More information about the Gcc-bugs mailing list