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

            Bug ID: 108479
           Summary: Internal compiler error: in type_memfn_rqual, at
                    cp/typeck.cc:10994
           Product: gcc
           Version: 12.2.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: etienne.doms at gmail dot com
  Target Milestone: ---

Created attachment 54316
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=54316&action=edit
Preprocessed source

Hello,

I was just playing on my lunch time and something blew up:

> [smod@syslt041-arch playground]$ g++ bug.cpp -std=c++20 -freport-bug
> bug.cpp: In instantiation of ‘class Foo<std::basic_ostream<char> >’:
> bug.cpp:34:30:   required from here
> bug.cpp:5:7: internal compiler error: in type_memfn_rqual, at 
> cp/typeck.cc:10994
>     5 | class Foo
>       |       ^~~
> 0x19e2ee8 internal_error(char const*, ...)
>       ???:0
> 0x65443c fancy_abort(char const*, int, char const*)
>       ???:0
> 0x69df2f finish_struct_1(tree_node*)
>       ???:0
> 0x7ed3c7 instantiate_class_template(tree_node*)
>       ???:0
> 0x83d035 complete_type(tree_node*)
>       ???:0
> 0x6fcc40 start_decl(cp_declarator const*, cp_decl_specifier_seq*, int, 
> tree_node*, tree_node*, tree_node**)
>       ???:0
> 0x7c7d9c c_parse_file()
>       ???:0
> 0x8dd47d c_common_parse_file()
>       ???:0
> Please submit a full bug report, with preprocessed source.
Got this on a up-to-date g++ 12.2.1 on ArchLinux:

> [smod@syslt041-arch playground]$ g++ -v
> Using built-in specs.
> COLLECT_GCC=g++
> COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-pc-linux-gnu/12.2.1/lto-wrapper
> Target: x86_64-pc-linux-gnu
> Configured with: /build/gcc/src/gcc/configure 
> --enable-languages=c,c++,ada,fortran,go,lto,objc,obj-c++,d --enable-bootstrap 
> --prefix=/usr --libdir=/usr/lib --libexecdir=/usr/lib --> 
> mandir=/usr/share/man --infodir=/usr/share/info 
> --with-bugurl=https://bugs.archlinux.org/ --with-build-config=bootstrap-lto 
> --with-linker-hash-style=gnu --with-system-zlib --enable-__cxa_atexit 
> --enable-cet=auto --enable-checking=release --enable-clocale=gnu 
> --enable-default-pie --enable-default-ssp --enable-gnu-indirect-function 
> --enable-gnu-unique-object --enable-libstdcxx-backtrace 
> --enable-link-serialization=1 --enable-linker-build-id --enable-lto 
> --enable-multilib --enable-plugin --enable-shared --enable-threads=posix 
> --disable-libssp --disable-libstdcxx-pch --disable-werror
> Thread model: posix
> Supported LTO compression algorithms: zlib zstd
> gcc version 12.2.1 20230111 (GCC) 
See attachment generated by "-freport-bug", as requested.

Probably related to #96745, but does not look identical to me.

Note that I was not trying to do something specific, I was reading about this
new shiny concept of "prospective destructor" and tried to instantiate my
template class with "T = decltype(std::cout)", I was expecting something like
"nope, no suitable dtor" but got this instead.

Cheers,
Etienne

Reply via email to