-
Notifications
You must be signed in to change notification settings - Fork 12k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Turn -Wdeprecated-literal-operator
on by default
#111027
Merged
Merged
Changes from 3 commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
21dc8df
Turn Wdeprecated-literal-operator on by default
erichkeane c45eda6
Suppress diagnostic in the case where there is no leading underscore,…
erichkeane f9a9f81
Update clang/docs/ReleaseNotes.rst
erichkeane c012c62
Merge branch 'main' into DeprecatedLiteralOpFix
erichkeane File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It isn't clear to me that this check was necessary at all? So I've removed it. Both diags happen now without the check, and unconditionally on each-other. They also share the
FixItHint
, which was done in a frightening-ish way.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we need it any longer because I believe we suppress diagnostics in system headers via the diagnostics engine itself; you can test it out by using GNU line markers to pretend some code is a system header: https://godbolt.org/z/PsaM19Pe8