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

            Bug ID: 118629
           Summary: ice in cp_parser_expression_statement, at
                    cp/parser.cc:13584
           Product: gcc
           Version: 15.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: dcb314 at hotmail dot com
  Target Milestone: ---

>From the clang C++ testsuite, file SemaCXX/crash-GH121274.cpp
does this with g++:

test $ ~/gcc/results/bin/gcc -c SemaCXX/crash-GH121274.cpp
SemaCXX/crash-GH121274.cpp: In function ‘void foo()’:
SemaCXX/crash-GH121274.cpp:8:11: internal compiler error: in
cp_parser_expression_statement, at cp/parser.cc:13584
    8 |         }();
      |           ^

Source code is

// RUN: %clang_cc1 -std=c++11 -verify %s
// expected-no-diagnostics

// Do not crash when __PRETTY_FUNCTION__ appears in the trailing return type of 
the lambda
void foo() {
        []() -> decltype(static_cast<const char*>(__PRETTY_FUNCTION__)) {
                return nullptr;
        }();

#ifdef MS
        []() -> decltype(static_cast<const char*>(__FUNCSIG__)) {
                return nullptr;
        }();
#endif
}

The clang test suite is at 

https://github.com/llvm/llvm-project/tree/main/clang/test

The code first goes wrong in g++ sometime before g:0b06abe027a78681

Reply via email to