forked from llvm/llvm-project
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Turn
-Wdeprecated-literal-operator
on by default (llvm#111027)
It would be nice to see what our users think about this change, as this is something that WG21/EWG quite wants to fix a handful of questionable issues with UB. Depending on the outcome of this after being committed, we might instead suggest EWG undeprecate this, and require a bit of 'magic' from the lexer. Additionally, this patch makes it so we emit this diagnostic ALSO in cases where the literal name is reserved. It doesn't make sense to limit that. --------- Co-authored-by: Vlad Serebrennikov <[email protected]>
- Loading branch information
Showing
32 changed files
with
236 additions
and
197 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
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 |
---|---|---|
@@ -1,18 +1,18 @@ | ||
// RUN: %clang_cc1 -fsyntax-only -std=c++11 -verify %s | ||
|
||
int &operator "" _x1 (unsigned long long); | ||
int &operator ""_x1 (unsigned long long); | ||
int &i1 = 0x123_x1; | ||
|
||
double &operator "" _x1 (const char *); | ||
double &operator ""_x1 (const char *); | ||
int &i2 = 45_x1; | ||
|
||
template<char...> char &operator "" _x1 (); | ||
template<char...> char &operator ""_x1 (); | ||
int &i3 = 0377_x1; | ||
|
||
int &i4 = 90000000000000000000000000000000000000000000000_x1; // expected-error {{integer literal is too large to be represented in any integer type}} | ||
|
||
double &operator "" _x2 (const char *); | ||
double &operator ""_x2 (const char *); | ||
double &i5 = 123123123123123123123123123123123123123123123_x2; | ||
|
||
template<char...Cs> constexpr int operator "" _x3() { return sizeof...(Cs); } | ||
template<char...Cs> constexpr int operator ""_x3() { return sizeof...(Cs); } | ||
static_assert(123456789012345678901234567890123456789012345678901234567890_x3 == 60, ""); |
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 |
---|---|---|
@@ -1,18 +1,18 @@ | ||
// RUN: %clang_cc1 -fsyntax-only -std=c++11 -verify %s | ||
|
||
int &operator "" _x1 (long double); | ||
int &operator ""_x1 (long double); | ||
int &i1 = 0.123_x1; | ||
|
||
double &operator "" _x1 (const char *); | ||
double &operator ""_x1 (const char *); | ||
int &i2 = 45._x1; | ||
|
||
template<char...> char &operator "" _x1 (); | ||
template<char...> char &operator ""_x1 (); | ||
int &i3 = 0377e-1_x1; | ||
|
||
int &i4 = 1e1000000_x1; // expected-warning {{too large for type 'long double'}} | ||
|
||
double &operator "" _x2 (const char *); | ||
double &operator ""_x2 (const char *); | ||
double &i5 = 1e1000000_x2; | ||
|
||
template<char...Cs> constexpr int operator "" _x3() { return sizeof...(Cs); } | ||
template<char...Cs> constexpr int operator ""_x3() { return sizeof...(Cs); } | ||
static_assert(1e1000000_x3 == 9, ""); |
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
Oops, something went wrong.