Skip to content

Commit 5261837

Browse files
committed
Minor edits
1 parent 74a9cf0 commit 5261837

File tree

5 files changed

+12
-10
lines changed

5 files changed

+12
-10
lines changed

clang/include/clang/Driver/Options.td

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3545,11 +3545,11 @@ def : Flag<["-"], "fno-aligned-new">, Alias<fno_aligned_allocation>;
35453545
def faligned_new_EQ : Joined<["-"], "faligned-new=">;
35463546
defm cxx_type_aware_allocators : BoolFOption<"experimental-cxx-type-aware-allocators",
35473547
LangOpts<"TypeAwareAllocators">, DefaultFalse,
3548-
PosFlag<SetTrue, [], [ClangOption], "Enable C++YY type aware allocator operators">,
3548+
PosFlag<SetTrue, [], [ClangOption], "Enable experimental C++YY type aware allocator operators">,
35493549
NegFlag<SetFalse>, BothFlags<[], [ClangOption, CC1Option]>>;
3550-
defm cxx_type_aware_destroying_delete : BoolFOption<"cxx-type-aware-destroying-delete",
3550+
defm cxx_type_aware_destroying_delete : BoolFOption<"experimental-cxx-type-aware-destroying-delete",
35513551
LangOpts<"TypeAwareDestroyingDelete">, DefaultFalse,
3552-
PosFlag<SetTrue, [], [ClangOption], "Enable C++YY type aware allocator operators">,
3552+
PosFlag<SetTrue, [], [ClangOption], "Enable experimental C++YY type aware allocator operators for destroying delete">,
35533553
NegFlag<SetFalse>, BothFlags<[], [ClangOption, CC1Option]>>;
35543554
def fobjc_legacy_dispatch : Flag<["-"], "fobjc-legacy-dispatch">, Group<f_Group>;
35553555
def fobjc_new_property : Flag<["-"], "fobjc-new-property">, Group<clang_ignored_f_Group>;

clang/lib/Driver/ToolChains/Clang.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7153,7 +7153,7 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
71537153

71547154
if (Args.hasFlag(options::OPT_fcxx_type_aware_destroying_delete,
71557155
options::OPT_fno_cxx_type_aware_destroying_delete, false))
7156-
CmdArgs.push_back("-fcxx-type-aware-destroying-delete");
7156+
CmdArgs.push_back("-fexperimental-cxx-type-aware-destroying-delete");
71577157

71587158
Args.AddLastArg(CmdArgs, options::OPT_fdouble_square_bracket_attributes,
71597159
options::OPT_fno_double_square_bracket_attributes);

clang/lib/Sema/SemaExprCXX.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2967,8 +2967,10 @@ bool Sema::FindAllocationFunctions(
29672967
if (R.empty()) {
29682968
if (NewScope == AFS_Class)
29692969
return true;
2970+
29702971
LookupQualifiedName(R, Context.getTranslationUnitDecl());
29712972
}
2973+
29722974
if (getLangOpts().OpenCLCPlusPlus && R.empty()) {
29732975
if (PlaceArgs.empty()) {
29742976
Diag(StartLoc, diag::err_openclcxx_not_supported) << "default new";
@@ -3171,7 +3173,7 @@ bool Sema::FindAllocationFunctions(
31713173
<< NewDiagIndex << OperatorNew;
31723174
Diag(OperatorDelete->getLocation(),
31733175
diag::note_type_aware_operator_declared)
3174-
<< DeleteDiagIndex << OperatorDelete->getDeclName();
3176+
<< DeleteDiagIndex << OperatorDelete;
31753177
}
31763178
if (IAP.PassTypeIdentity &&
31773179
OperatorDelete->getDeclContext() != OperatorNew->getDeclContext()) {
@@ -3182,7 +3184,7 @@ bool Sema::FindAllocationFunctions(
31823184
Diag(OperatorNew->getLocation(), diag::err_type_aware_operator_found)
31833185
<< OperatorNew << OperatorNew->getDeclContext();
31843186
Diag(OperatorDelete->getLocation(), diag::err_type_aware_operator_found)
3185-
<< OperatorDelete->getDeclName() << OperatorDelete->getDeclContext();
3187+
<< OperatorDelete << OperatorDelete->getDeclContext();
31863188
}
31873189

31883190
// C++1z [expr.new]p23:

clang/test/SemaCXX/type-aware-new-delete-basic-in-class-declarations.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// RUN: %clang_cc1 -fsyntax-only -verify %s -DNO_TADD -std=c++17 -fexperimental-cxx-type-aware-allocators
2-
// RUN: %clang_cc1 -fsyntax-only -verify %s -std=c++17 -fexperimental-cxx-type-aware-allocators -fcxx-type-aware-destroying-delete
2+
// RUN: %clang_cc1 -fsyntax-only -verify %s -std=c++17 -fexperimental-cxx-type-aware-allocators -fexperimental-cxx-type-aware-destroying-delete
33
// RUN: %clang_cc1 -fsyntax-only -verify %s -DNO_TAA -std=c++17 -fno-experimental-cxx-type-aware-allocators
44

55
namespace std {

clang/test/SemaCXX/type-aware-new-delete-basic-resolution.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// RUN: %clang_cc1 -fsyntax-only -verify %s -std=c++2c -fexperimental-cxx-type-aware-allocators -fexceptions
2-
// RUN: %clang_cc1 -fsyntax-only -verify %s -DTADD -std=c++2c -fexperimental-cxx-type-aware-allocators -fcxx-type-aware-destroying-delete -fexceptions
2+
// RUN: %clang_cc1 -fsyntax-only -verify %s -DTADD -std=c++2c -fexperimental-cxx-type-aware-allocators -fexperimental-cxx-type-aware-destroying-delete -fexceptions
33

44
namespace std {
55
template <class T> struct type_identity {};
@@ -355,12 +355,12 @@ void test() {
355355
SubClass6_1 *O22 = new SubClass6_1;
356356
// expected-error@-1 {{type aware 'operator new<SubClass6_1>' requires matching 'operator delete' in 'SubClass6_1'}}
357357
// expected-note@#62 {{type aware 'operator new<SubClass6_1>' found in 'SubClass6_1'}}
358-
// expected-note@#61 {{type aware 'operator delete' found in 'BaseClass6'}}
358+
// expected-note@#61 {{type aware 'operator delete<SubClass6_1>' found in 'BaseClass6'}}
359359
delete O22;
360360

361361
SubClass6_2 *O23 = new SubClass6_2;
362362
// expected-error@-1 {{type aware 'operator new<SubClass6_2>' requires matching 'operator delete' in 'BaseClass6'}}
363363
// expected-note@#60 {{type aware 'operator new<SubClass6_2>' found in 'BaseClass6'}}
364-
// expected-note@#63 {{type aware 'operator delete' found in 'SubClass6_2'}}
364+
// expected-note@#63 {{type aware 'operator delete<SubClass6_2>' found in 'SubClass6_2'}}
365365
delete O23;
366366
}

0 commit comments

Comments
 (0)