The code would assume that SubstExpr() cannot fail on concept specialization. This is incorret - we give up on some things after fatal error occurred, since there's no value in doing futher work that the user will not see anyway. In this case, this lead to crash. The fatal error is simulated in tests with -ferror-limit=1, but this could happen in other cases too. Fixes https://github.com/llvm/llvm-project/issues/55401 Differential Revision: https://reviews.llvm.org/D129499
11 lines
454 B
C++
11 lines
454 B
C++
// RUN: not %clang_cc1 -fsyntax-only -std=c++20 -ferror-limit 1 -verify %s
|
|
|
|
template <class>
|
|
concept f = requires { 42; };
|
|
struct h {
|
|
// The missing semicolon will trigger an error and -ferror-limit=1 will make it fatal
|
|
// We test that we do not crash in such cases (#55401)
|
|
int i = requires { { i } f } // expected-error {{expected ';' at end of declaration list}}
|
|
// expected-error@* {{too many errros emitted}}
|
|
};
|