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

            Bug ID: 116931
           Summary: False "duplicate 'const'" errors when typedefs used on
                    pointer types in function definitions
           Product: gcc
           Version: 13.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: mattreecebentley at gmail dot com
  Target Milestone: ---

Created attachment 59263
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=59263&action=edit
Preprocessed file of bug demonstration.

This bug is problematic for scenarios where the dev is obtaining a pointer type
from the allocator eg. std::allocator_traits<some_type>::pointer,
but will show up anywhere typedefs are used for pointer types.

In short, const int * const works, const int_pointer const doesn't under GCC.


the exact version of GCC: 

13.2.0


the system type: 

x86_64-w64-mingw32, windows, x64


Configured with:

 ../src/configure --enable-languages=c,c++ --build=x86_64-w64-mingw32
--host=x86_64-w64-mingw32 --target=x86_64-w64-mingw32 --disable-multilib
--prefix=/e/temp/gcc/dest --with-sysroot=/e/temp/gcc/dest
--disable-libstdcxx-pch --disable-libstdcxx-verbose --disable-nls
--disable-shared --disable-win32-registry --enable-threads=posix
--enable-libgomp --with-zstd=/c/mingw


the complete command line that triggers the bug: 

C:/programming/libraries/nuwen/bin/g++.exe  -c 
"C:/programming/workspaces/bugreport/bugreport/bug_report.cpp" -g -Wall
-save-temps  -o build-Debug/bug_report.cpp.o -I. -I.


the compiler output (error messages, warnings, etc.):

C:/programming/workspaces/bugreport/bugreport/bug_report.cpp:3:37: error:
duplicate 'const'
    3 | int test_fail(const integer_pointer const p)
      |                                     ^~~~~
      |                                     -----

Reply via email to