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

Martin Sebor <msebor at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |msebor at gcc dot gnu.org

--- Comment #1 from Martin Sebor <msebor at gcc dot gnu.org> ---
GCC 8.0 prints the following error (please remember to include compiler
output):

pr81678.C:2:19: error: variable or field ‘f’ declared void
 void f (void (T::*...)())
                   ^~~
pr81678.C:2:9: error: expected primary-expression before ‘void’
 void f (void (T::*...)())
         ^~~~
pr81678.C: In function ‘int main()’:
pr81678.C:14:3: error: ‘f’ was not declared in this scope
   f (&C::f);
   ^

Clang compiles it fine but MSVC and EDG don't.  EDG gives the following error:

$ eccp -A --c++17 pr81678.C
"pr81678.C", line 2: error: an unnamed parameter pack declaration cannot be
          parenthesized
  void f (void (T::*...)())
                    ^

Based on [dcl.fct] of N4700 I suspect this may be an ambiguity in the grammar
that Clang handles more gracefully than other implementations but I'm not an
expert on the C++ grammar so I'll leave it to someone else to either confirm or
close.

Reply via email to