Skip to content

Commit 4c7587a

Browse files
committed
Correct naming, add preprocessor define
1 parent a7032fa commit 4c7587a

File tree

4 files changed

+9
-5
lines changed

4 files changed

+9
-5
lines changed

clang/include/clang/Sema/Sema.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4890,7 +4890,7 @@ class Sema final : public SemaBase {
48904890
///
48914891
/// \returns The instantiated template, or null if std::type_identity is not
48924892
/// declared
4893-
QualType TryBuildStdTypeIdentity(QualType Type, SourceLocation Loc);
4893+
QualType tryBuildStdTypeIdentity(QualType Type, SourceLocation Loc);
48944894

48954895
/// Determine whether Ctor is an initializer-list constructor, as
48964896
/// defined in [dcl.init.list]p2.

clang/lib/Frontend/InitPreprocessor.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -772,6 +772,10 @@ static void InitializeCPlusPlusFeatureTestMacros(const LangOptions &LangOpts,
772772
if (LangOpts.Char8)
773773
Builder.defineMacro("__cpp_char8_t", "202207L");
774774
Builder.defineMacro("__cpp_impl_destroying_delete", "201806L");
775+
776+
// TODO: Final number?
777+
if (LangOpts.TypeAwareAllocators)
778+
Builder.defineMacro("__cpp_type_aware_allocators", "202500L");
775779
}
776780

777781
/// InitializeOpenCLFeatureTestMacros - Define OpenCL macros based on target

clang/lib/Sema/SemaDeclCXX.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12183,7 +12183,7 @@ QualType Sema::BuildStdInitializerList(QualType Element, SourceLocation Loc) {
1218312183
return BuildStdClassTemplate(*this, StdInitializerList, Element, Loc);
1218412184
}
1218512185

12186-
QualType Sema::TryBuildStdTypeIdentity(QualType Type, SourceLocation Loc) {
12186+
QualType Sema::tryBuildStdTypeIdentity(QualType Type, SourceLocation Loc) {
1218712187
if (!StdTypeIdentity) {
1218812188
StdTypeIdentity = LookupStdClassTemplate(*this, Loc, "type_identity",
1218912189
/* WasMalformed */ nullptr);
@@ -16339,7 +16339,7 @@ Sema::BuildTypeAwareUsualDelete(FunctionTemplateDecl *FnTemplateDecl,
1633916339
return nullptr;
1634016340
}
1634116341

16342-
QualType SpecializedTypeIdentity = TryBuildStdTypeIdentity(DeallocType, Loc);
16342+
QualType SpecializedTypeIdentity = tryBuildStdTypeIdentity(DeallocType, Loc);
1634316343
if (SpecializedTypeIdentity.isNull())
1634416344
return nullptr;
1634516345

clang/lib/Sema/SemaExprCXX.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1811,7 +1811,7 @@ namespace {
18111811
}
18121812
QualType TypeIdentityTag = FD->getParamDecl(0)->getType();
18131813
QualType ExpectedTypeIdentityTag =
1814-
S.TryBuildStdTypeIdentity(AllocType, Loc);
1814+
S.tryBuildStdTypeIdentity(AllocType, Loc);
18151815
if (ExpectedTypeIdentityTag.isNull()) {
18161816
FD = nullptr;
18171817
return;
@@ -2957,7 +2957,7 @@ bool Sema::FindAllocationFunctions(
29572957
QualType TypeIdentity = Context.getSizeType();
29582958
if (isTypeAwareAllocation(IAP.PassTypeIdentity)) {
29592959
QualType SpecializedTypeIdentity =
2960-
TryBuildStdTypeIdentity(IAP.Type, StartLoc);
2960+
tryBuildStdTypeIdentity(IAP.Type, StartLoc);
29612961
if (!SpecializedTypeIdentity.isNull()) {
29622962
TypeIdentity = SpecializedTypeIdentity;
29632963
if (RequireCompleteType(StartLoc, TypeIdentity,

0 commit comments

Comments
 (0)