mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-17 17:36:36 +00:00

We're expecting a SubstitutionDiagnostic in diagnoseUnsatisfiedRequirement if the status of ExprRequirement is SubstFailure. Previously, the Requirement was created with Expr on SubstFailure by mistake, which could lead to the assertion failure in the subsequent diagnosis. Fixes https://github.com/clangd/clangd/issues/1726 Fixes https://github.com/llvm/llvm-project/issues/64723 Fixes https://github.com/llvm/llvm-project/issues/64172 In addition, this patch also fixes an invalid test from D129499. Reviewed By: erichkeane Differential Revision: https://reviews.llvm.org/D158061
11 lines
450 B
C++
11 lines
450 B
C++
// RUN: %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 errors emitted}}
|
|
};
|