forked from llvm/llvm-project
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Clang] Backport static_assert messages fixes
* 4d494e7: Handle static_assert messages with an expression started by a literal * 49e0495 Produce a warning instead of an error in unevaluated strings before C++26 Emiting an error on unexpected encoding prefix - which was allowed before C++26 - caused build errors for a few users. This downgrade the error to a warning on older language modes and C
- Loading branch information
Showing
8 changed files
with
110 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// RUN: %clang_cc1 -verify -std=c++2c %s | ||
// RUN: cp %s %t | ||
// RUN: not %clang_cc1 -x c++ -std=c++2c -fixit %t | ||
// RUN: %clang_cc1 -x c++ -std=c++2c %t | ||
// RUN: not %clang_cc1 -std=c++2c -x c++ -fsyntax-only -fdiagnostics-parseable-fixits %s 2>&1 | FileCheck %s | ||
|
||
static_assert(true, L""); // expected-error{{an unevaluated string literal cannot have an encoding prefix}} | ||
// CHECK: fix-it:{{.*}}:{7:21-7:22} | ||
|
||
static_assert(true, u8""); // expected-error{{an unevaluated string literal cannot have an encoding prefix}} | ||
// CHECK: fix-it:{{.*}}:{10:21-10:23} | ||
|
||
static_assert(true, u""); // expected-error{{an unevaluated string literal cannot have an encoding prefix}} | ||
// CHECK: fix-it:{{.*}}:{13:21-13:22} | ||
|
||
static_assert(true, U""); // expected-error{{an unevaluated string literal cannot have an encoding prefix}} | ||
// CHECK: fix-it:{{.*}}:{16:21-16:22} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters