aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Basic/IdentifierTable.cpp
diff options
context:
space:
mode:
authorErich Keane <ekeane@nvidia.com>2024-10-11 06:10:03 -0700
committerGitHub <noreply@github.com>2024-10-11 06:10:03 -0700
commitc8554e13eec048180d003af2aa7b2cc8498d4fba (patch)
tree7175c2d50e89135fcb8676b75e2637eec9e889f1 /clang/lib/Basic/IdentifierTable.cpp
parent870d37dd1257d211f96797bf041280b2260ed260 (diff)
downloadllvm-c8554e13eec048180d003af2aa7b2cc8498d4fba.zip
llvm-c8554e13eec048180d003af2aa7b2cc8498d4fba.tar.gz
llvm-c8554e13eec048180d003af2aa7b2cc8498d4fba.tar.bz2
Turn `-Wdeprecated-literal-operator` on by default (#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 <serebrennikov.vladislav@gmail.com>
Diffstat (limited to 'clang/lib/Basic/IdentifierTable.cpp')
-rw-r--r--clang/lib/Basic/IdentifierTable.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/clang/lib/Basic/IdentifierTable.cpp b/clang/lib/Basic/IdentifierTable.cpp
index c9c9d92..16151c9 100644
--- a/clang/lib/Basic/IdentifierTable.cpp
+++ b/clang/lib/Basic/IdentifierTable.cpp
@@ -406,6 +406,9 @@ ReservedLiteralSuffixIdStatus
IdentifierInfo::isReservedLiteralSuffixId() const {
StringRef Name = getName();
+ // Note: the diag::warn_deprecated_literal_operator_id diagnostic depends on
+ // this being the first check we do, so if this order changes, we have to fix
+ // that as well.
if (Name[0] != '_')
return ReservedLiteralSuffixIdStatus::NotStartsWithUnderscore;