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

            Bug ID: 68996
           Summary: Decltype-specifier in declarator-id should not be
                    accepted
           Product: gcc
           Version: 5.1.0
            Status: UNCONFIRMED
          Keywords: accepts-invalid
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: zeratul976 at hotmail dot com
  Target Milestone: ---

GCC accepts the following code:

  struct{
      void test();
  } a;

  void decltype(a)::test(){}

I believe this is invalid, due to the following sentence in [dcl.meaning] p1:

  The nested-name-specifier of a qualified declarator-id shall
  not begin with a decltype-specifier.

Is this an oversight, or deliberately supported as an extension?

Reply via email to