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

            Bug ID: 101982
           Summary: function parameter should not accept auto as
                    placeholder-type-specifier
           Product: gcc
           Version: 7.5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: nickhuang99 at hotmail dot com
  Target Milestone: ---

GCC7.5 accepts *auto* as placeholder-type-specifier without error or warning.
Considering following code snippet is legal only with -std=c++20:

   void f(auto i){} 

GCC8.x and later gives warning which is at least not incorrect. As a contrast,
both clang (https://www.godbolt.org/z/9x6E5xrne) and
MSVC(https://www.godbolt.org/z/3hWPsrcqz) considers it is illegal without
-std=c++20 option which is compliant with spec: 

   warning: use of ‘auto’ in parameter declaration only available with
‘-fconcepts-ts’

Reply via email to