Skip to content

Commit 5ca99e4

Browse files
committed
Address review comments: minor changes to tablegen descriptions
Revert note in ReleaseNotes Remove no_unique_address test
1 parent 1de5966 commit 5ca99e4

File tree

3 files changed

+5
-17
lines changed

3 files changed

+5
-17
lines changed

clang/include/clang/Basic/DiagnosticSemaKinds.td

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1788,12 +1788,12 @@ def note_unsatisfied_trait_reason
17881788
"%NonReplaceableField{has a non-replaceable member %1 of type %2}|"
17891789
"%NTCBase{has a non-trivially-copyable base %1}|"
17901790
"%NTCField{has a non-trivially-copyable member %1 of type %2}|"
1791-
"%NonStdLayoutBase{has a non-standard-layout base %1}|"
1791+
"%NonStandardLayoutBase{has a non-standard-layout base %1}|"
17921792
"%MixedAccess{has mixed access specifiers}|"
17931793
"%MixedAccessField{field %1 has a different access specifier than field %2}|"
17941794
"%MultipleDataBase{has multiple base classes with data members}|"
17951795
"%VirtualFunction{has a virtual function}|"
1796-
"%NonStdLayoutMember{has a non-standard-layout member %1 of type %2}|"
1796+
"%NonStandardLayoutMember{has a non-standard-layout member %1 of type %2}|"
17971797
"%IndirectBaseWithFields{has an indirect base %1 with data members}|"
17981798
"%DeletedDtr{has a %select{deleted|user-provided}1 destructor}|"
17991799
"%UserProvidedCtr{has a user provided %select{copy|move}1 "

clang/lib/Sema/SemaTypeTraits.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2315,7 +2315,7 @@ static void DiagnoseNonStandardLayoutReason(Sema &SemaRef, SourceLocation Loc,
23152315
}
23162316
if (!B.getType()->isStandardLayoutType()) {
23172317
SemaRef.Diag(Loc, diag::note_unsatisfied_trait_reason)
2318-
<< diag::TraitNotSatisfiedReason::NonStdLayoutBase << B.getType()
2318+
<< diag::TraitNotSatisfiedReason::NonStandardLayoutBase << B.getType()
23192319
<< B.getSourceRange();
23202320
}
23212321
}
@@ -2369,7 +2369,7 @@ static void DiagnoseNonStandardLayoutReason(Sema &SemaRef, SourceLocation Loc,
23692369
for (const FieldDecl *Field : D->fields()) {
23702370
if (!Field->getType()->isStandardLayoutType()) {
23712371
SemaRef.Diag(Loc, diag::note_unsatisfied_trait_reason)
2372-
<< diag::TraitNotSatisfiedReason::NonStdLayoutMember << Field
2372+
<< diag::TraitNotSatisfiedReason::NonStandardLayoutMember << Field
23732373
<< Field->getType() << Field->getSourceRange();
23742374
}
23752375
}

clang/test/SemaCXX/type-traits-unsatisfied-diags.cpp

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -619,17 +619,5 @@ static_assert(__is_standard_layout(H)); // no diagnostics
619619

620620
struct I { Empty a; int : 0; int x; }; // #sl-I
621621
static_assert(__is_standard_layout(I)); // no diagnostics
622-
623-
// [[no_unique_address]] or [[msvc::no_unique_address]] should not affect standard layout
624-
#if __has_cpp_attribute(no_unique_address)
625-
#define NO_UNIQUE_ADDRESS [[no_unique_address]]
626-
#elif __has_cpp_attribute(msvc::no_unique_address)
627-
#define NO_UNIQUE_ADDRESS [[msvc::no_unique_address]]
628-
#elif defined(_MSC_VER)
629-
#define NO_UNIQUE_ADDRESS __declspec(no_unique_address)
630-
#else
631-
#define NO_UNIQUE_ADDRESS /* nothing */
632-
#endif
633-
struct J { NO_UNIQUE_ADDRESS Empty a; int x; };
634-
static_assert(__is_standard_layout(J)); // no diagnostics
635622
}
623+

0 commit comments

Comments
 (0)