[clang] 7eead18 - [Clang] NFC: Make UnqualifiedId::Kind private for consistency.
Corentin Jabot via cfe-commits
cfe-commits at lists.llvm.org
Mon Sep 12 10:14:41 PDT 2022
Author: Corentin Jabot
Date: 2022-09-12T19:14:06+02:00
New Revision: 7eead180b92dcff7eaf9d71df14e33936ec4dbe5
URL: https://github.com/llvm/llvm-project/commit/7eead180b92dcff7eaf9d71df14e33936ec4dbe5
DIFF: https://github.com/llvm/llvm-project/commit/7eead180b92dcff7eaf9d71df14e33936ec4dbe5.diff
LOG: [Clang] NFC: Make UnqualifiedId::Kind private for consistency.
Differential Revision: https://reviews.llvm.org/D133703
Added:
Modified:
clang/include/clang/Sema/DeclSpec.h
clang/lib/Sema/DeclSpec.cpp
clang/lib/Sema/SemaDecl.cpp
clang/lib/Sema/SemaDeclCXX.cpp
Removed:
################################################################################
diff --git a/clang/include/clang/Sema/DeclSpec.h b/clang/include/clang/Sema/DeclSpec.h
index bb49151c77248..1aa335b8b9b7a 100644
--- a/clang/include/clang/Sema/DeclSpec.h
+++ b/clang/include/clang/Sema/DeclSpec.h
@@ -964,10 +964,10 @@ class UnqualifiedId {
UnqualifiedId(const UnqualifiedId &Other) = delete;
const UnqualifiedId &operator=(const UnqualifiedId &) = delete;
-public:
/// Describes the kind of unqualified-id parsed.
UnqualifiedIdKind Kind;
+public:
struct OFI {
/// The kind of overloaded operator.
OverloadedOperatorKind Operator;
diff --git a/clang/lib/Sema/DeclSpec.cpp b/clang/lib/Sema/DeclSpec.cpp
index 6875d3d97c282..0c4b79d8b9642 100644
--- a/clang/lib/Sema/DeclSpec.cpp
+++ b/clang/lib/Sema/DeclSpec.cpp
@@ -413,7 +413,7 @@ bool Declarator::isDeclarationOfFunction() const {
bool Declarator::isStaticMember() {
assert(getContext() == DeclaratorContext::Member);
return getDeclSpec().getStorageClassSpec() == DeclSpec::SCS_static ||
- (getName().Kind == UnqualifiedIdKind::IK_OperatorFunctionId &&
+ (getName().getKind() == UnqualifiedIdKind::IK_OperatorFunctionId &&
CXXMethodDecl::isStaticOverloadedOperator(
getName().OperatorFunctionId.Operator));
}
diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp
index 6e94da4a115eb..9d0e6769f0875 100644
--- a/clang/lib/Sema/SemaDecl.cpp
+++ b/clang/lib/Sema/SemaDecl.cpp
@@ -6586,8 +6586,8 @@ Sema::ActOnTypedefDeclarator(Scope* S, Declarator& D, DeclContext* DC,
Diag(D.getDeclSpec().getConstexprSpecLoc(), diag::err_invalid_constexpr)
<< 1 << static_cast<int>(D.getDeclSpec().getConstexprSpecifier());
- if (D.getName().Kind != UnqualifiedIdKind::IK_Identifier) {
- if (D.getName().Kind == UnqualifiedIdKind::IK_DeductionGuideName)
+ if (D.getName().getKind() != UnqualifiedIdKind::IK_Identifier) {
+ if (D.getName().getKind() == UnqualifiedIdKind::IK_DeductionGuideName)
Diag(D.getName().StartLocation,
diag::err_deduction_guide_invalid_specifier)
<< "typedef";
diff --git a/clang/lib/Sema/SemaDeclCXX.cpp b/clang/lib/Sema/SemaDeclCXX.cpp
index 9a2ee556fc2e0..6463d0678007d 100644
--- a/clang/lib/Sema/SemaDeclCXX.cpp
+++ b/clang/lib/Sema/SemaDeclCXX.cpp
@@ -13009,7 +13009,7 @@ Decl *Sema::ActOnAliasDeclaration(Scope *S, AccessSpecifier AS,
Previous.clear();
}
- assert(Name.Kind == UnqualifiedIdKind::IK_Identifier &&
+ assert(Name.getKind() == UnqualifiedIdKind::IK_Identifier &&
"name in alias declaration must be an identifier");
TypeAliasDecl *NewTD = TypeAliasDecl::Create(Context, CurContext, UsingLoc,
Name.StartLocation,
More information about the cfe-commits
mailing list