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

            Bug ID: 127820
           Summary: Invalid abstract pack declarators accepted without
                    pedantic warning
           Product: gcc
           Version: 17.0
            Status: UNCONFIRMED
          Keywords: accepts-invalid
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: luigighiron at gmail dot com
  Target Milestone: ---

The following code is incorrectly accepted by GCC:

template<int(*)()...>void foo();
template<typename...T>void bar(T(*)()...);
int main(){}

These templates are grammatically invalid, but are accepted even when using
-pedantic-errors. Also note that Clang supports them, but with a pedantic
warning and the syntax (*...)() instead of (*)()... which aligns more closely
to how declarators normally work. See also C++ CWG 1488.
  • [Bug c++/127820] New: Invalid ab... luigighiron at gmail dot com via Gcc-bugs

Reply via email to