Skip to content

Commit 80154c2

Browse files
committed
Missed a -fexperimental change and adding flag names to diagnostics
1 parent 5261837 commit 80154c2

File tree

3 files changed

+34
-34
lines changed

3 files changed

+34
-34
lines changed

clang/include/clang/Basic/DiagnosticSemaKinds.td

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9708,9 +9708,9 @@ def err_destroying_operator_delete_not_usual : Error<
97089708
"destroying operator delete can have only an optional size and optional "
97099709
"alignment parameter">;
97109710
def err_type_aware_destroying_operator_delete : Error<
9711-
"type aware destroying delete is not permitted">;
9711+
"type aware destroying delete is not permitted, enable with '-fexperimental-cxx-type-aware-destroying-delete'">;
97129712
def err_unsupported_type_aware_allocator : Error<
9713-
"type aware allocation operators are disabled">;
9713+
"type aware allocation operators are disabled, enable with '-fexperimental-cxx-type-aware-allocators'">;
97149714
def err_no_matching_type_aware_cleanup_deallocator_mismatch : Error<
97159715
"type aware %0 requires matching %1 in %2">;
97169716
def err_type_aware_operator_found : Note<

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

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -22,61 +22,61 @@ template <typename T> void *operator new(std::type_identity<TemplateTestType<T>>
2222
template <typename T, typename U> void *operator new(std::type_identity<T>, size_t, TemplateTestType<U>&); // #7
2323
template <template <typename> class T> void *operator new(std::type_identity<T<int>>, size_t); // #8
2424
#if defined(NO_TAA)
25-
//expected-error@#1 {{type aware allocation operators are disabled}}
26-
//expected-error@#2 {{type aware allocation operators are disabled}}
27-
//expected-error@#3 {{type aware allocation operators are disabled}}
28-
//expected-error@#4 {{type aware allocation operators are disabled}}
29-
//expected-error@#5 {{type aware allocation operators are disabled}}
30-
//expected-error@#6 {{type aware allocation operators are disabled}}
31-
//expected-error@#7 {{type aware allocation operators are disabled}}
32-
//expected-error@#8 {{type aware allocation operators are disabled}}
25+
//expected-error@#1 {{type aware allocation operators are disabled, enable with '-fexperimental-cxx-type-aware-allocators'}}
26+
//expected-error@#2 {{type aware allocation operators are disabled, enable with '-fexperimental-cxx-type-aware-allocators'}}
27+
//expected-error@#3 {{type aware allocation operators are disabled, enable with '-fexperimental-cxx-type-aware-allocators'}}
28+
//expected-error@#4 {{type aware allocation operators are disabled, enable with '-fexperimental-cxx-type-aware-allocators'}}
29+
//expected-error@#5 {{type aware allocation operators are disabled, enable with '-fexperimental-cxx-type-aware-allocators'}}
30+
//expected-error@#6 {{type aware allocation operators are disabled, enable with '-fexperimental-cxx-type-aware-allocators'}}
31+
//expected-error@#7 {{type aware allocation operators are disabled, enable with '-fexperimental-cxx-type-aware-allocators'}}
32+
//expected-error@#8 {{type aware allocation operators are disabled, enable with '-fexperimental-cxx-type-aware-allocators'}}
3333
#endif
3434

3535
void operator delete(std::type_identity<int>, void *); // #9
3636
void operator delete(std::type_identity<int>, void *, std::align_val_t); // #10
3737
void operator delete(std::type_identity<int>, void *, size_t); // #11
3838
void operator delete(std::type_identity<int>, void *, size_t, std::align_val_t); // #12
3939
#if defined(NO_TAA)
40-
//expected-error@#9 {{type aware allocation operators are disabled}}
41-
//expected-error@#10 {{type aware allocation operators are disabled}}
42-
//expected-error@#11 {{type aware allocation operators are disabled}}
43-
//expected-error@#12 {{type aware allocation operators are disabled}}
40+
//expected-error@#9 {{type aware allocation operators are disabled, enable with '-fexperimental-cxx-type-aware-allocators'}}
41+
//expected-error@#10 {{type aware allocation operators are disabled, enable with '-fexperimental-cxx-type-aware-allocators'}}
42+
//expected-error@#11 {{type aware allocation operators are disabled, enable with '-fexperimental-cxx-type-aware-allocators'}}
43+
//expected-error@#12 {{type aware allocation operators are disabled, enable with '-fexperimental-cxx-type-aware-allocators'}}
4444
#endif
4545

4646
template <typename T> void operator delete(std::type_identity<T>, void *); // #13
4747
template <typename T> void operator delete(std::type_identity<T>, void *, std::align_val_t); // #14
4848
template <typename T> void operator delete(std::type_identity<T>, void *, size_t); // #15
4949
template <typename T> void operator delete(std::type_identity<T>, void *, size_t, std::align_val_t); // #16
5050
#if defined(NO_TAA)
51-
//expected-error@#13 {{type aware allocation operators are disabled}}
52-
//expected-error@#14 {{type aware allocation operators are disabled}}
53-
//expected-error@#15 {{type aware allocation operators are disabled}}
54-
//expected-error@#16 {{type aware allocation operators are disabled}}
51+
//expected-error@#13 {{type aware allocation operators are disabled, enable with '-fexperimental-cxx-type-aware-allocators'}}
52+
//expected-error@#14 {{type aware allocation operators are disabled, enable with '-fexperimental-cxx-type-aware-allocators'}}
53+
//expected-error@#15 {{type aware allocation operators are disabled, enable with '-fexperimental-cxx-type-aware-allocators'}}
54+
//expected-error@#16 {{type aware allocation operators are disabled, enable with '-fexperimental-cxx-type-aware-allocators'}}
5555
#endif
5656

5757
template <typename T> void operator delete(std::type_identity<TemplateTestType<T>>, void *); // #17
5858
template <template <typename> class T> void operator delete(std::type_identity<T<int>>, void *); // #18
5959
#if defined(NO_TAA)
60-
//expected-error@#17 {{type aware allocation operators are disabled}}
61-
//expected-error@#18 {{type aware allocation operators are disabled}}
60+
//expected-error@#17 {{type aware allocation operators are disabled, enable with '-fexperimental-cxx-type-aware-allocators'}}
61+
//expected-error@#18 {{type aware allocation operators are disabled, enable with '-fexperimental-cxx-type-aware-allocators'}}
6262
#endif
6363

6464
typedef std::type_identity<float> TypeIdentityAlias1;
6565
void *operator new(TypeIdentityAlias1, size_t); // #19
6666
#if defined(NO_TAA)
67-
//expected-error@#19 {{type aware allocation operators are disabled}}
67+
//expected-error@#19 {{type aware allocation operators are disabled, enable with '-fexperimental-cxx-type-aware-allocators'}}
6868
#endif
6969

7070
using TypeIdentityAlias2 = std::type_identity<double>;
7171
void *operator new(TypeIdentityAlias2, size_t); // #20
7272
#if defined(NO_TAA)
73-
//expected-error@#20 {{type aware allocation operators are disabled}}
73+
//expected-error@#20 {{type aware allocation operators are disabled, enable with '-fexperimental-cxx-type-aware-allocators'}}
7474
#endif
7575

7676
template <typename T> using TypeIdentityAlias3 = std::type_identity<T>;
7777
template <typename T> void *operator new(TypeIdentityAlias3<T>, size_t); // #21
7878
#if defined(NO_TAA)
79-
//expected-error@#21 {{type aware allocation operators are disabled}}
79+
//expected-error@#21 {{type aware allocation operators are disabled, enable with '-fexperimental-cxx-type-aware-allocators'}}
8080
#endif
8181

8282

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

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ struct S {
1515
void *operator new(std::type_identity<S>, size_t); // #1
1616
void operator delete(std::type_identity<S>, void *); // #2
1717
#if defined(NO_TAA)
18-
//expected-error@#1 {{type aware allocation operators are disabled}}
19-
//expected-error@#2 {{type aware allocation operators are disabled}}
18+
//expected-error@#1 {{type aware allocation operators are disabled, enable with '-fexperimental-cxx-type-aware-allocators'}}
19+
//expected-error@#2 {{type aware allocation operators are disabled, enable with '-fexperimental-cxx-type-aware-allocators'}}
2020
#endif
2121
void operator delete(S *, std::destroying_delete_t);
2222
};
@@ -25,8 +25,8 @@ template <typename T> struct S2 {
2525
void *operator new(std::type_identity<S2<T>>, size_t); // #3
2626
void operator delete(std::type_identity<S2<T>>, void *); // #4
2727
#if defined(NO_TAA)
28-
//expected-error@#3 {{type aware allocation operators are disabled}}
29-
//expected-error@#4 {{type aware allocation operators are disabled}}
28+
//expected-error@#3 {{type aware allocation operators are disabled, enable with '-fexperimental-cxx-type-aware-allocators'}}
29+
//expected-error@#4 {{type aware allocation operators are disabled, enable with '-fexperimental-cxx-type-aware-allocators'}}
3030
#endif
3131
void operator delete(S2 *, std::destroying_delete_t);
3232
};
@@ -35,8 +35,8 @@ struct S3 {
3535
template <typename T> void *operator new(std::type_identity<T>, size_t); // #5
3636
template <typename T> void operator delete(std::type_identity<T>, void *); // #6
3737
#if defined(NO_TAA)
38-
//expected-error@#5 {{type aware allocation operators are disabled}}
39-
//expected-error@#6 {{type aware allocation operators are disabled}}
38+
//expected-error@#5 {{type aware allocation operators are disabled, enable with '-fexperimental-cxx-type-aware-allocators'}}
39+
//expected-error@#6 {{type aware allocation operators are disabled, enable with '-fexperimental-cxx-type-aware-allocators'}}
4040
#endif
4141
void operator delete(S3 *, std::destroying_delete_t);
4242
};
@@ -46,18 +46,18 @@ struct S4 {
4646
template <typename T> void operator delete(std::type_identity<T>, void *); // #8
4747
template <typename T> void operator delete(std::type_identity<T>, S4 *, std::destroying_delete_t); // #9
4848
#if defined(NO_TAA)
49-
//expected-error@#7 {{type aware allocation operators are disabled}}
50-
//expected-error@#8 {{type aware allocation operators are disabled}}
51-
//expected-error@#9 {{type aware allocation operators are disabled}}
49+
//expected-error@#7 {{type aware allocation operators are disabled, enable with '-fexperimental-cxx-type-aware-allocators'}}
50+
//expected-error@#8 {{type aware allocation operators are disabled, enable with '-fexperimental-cxx-type-aware-allocators'}}
51+
//expected-error@#9 {{type aware allocation operators are disabled, enable with '-fexperimental-cxx-type-aware-allocators'}}
5252
#elif defined(NO_TADD)
53-
// expected-error@#9 {{type aware destroying delete is not permitted}}
53+
// expected-error@#9 {{type aware destroying delete is not permitted, enable with '-fexperimental-cxx-type-aware-destroying-delete'}}
5454
#endif
5555
};
5656

5757
struct S5 {
5858
template <typename T> void operator delete(std::type_identity<T>, T *); // #10
5959
#if defined(NO_TAA)
60-
// expected-error@#10 {{type aware allocation operators are disabled}}
60+
// expected-error@#10 {{type aware allocation operators are disabled, enable with '-fexperimental-cxx-type-aware-allocators'}}
6161
#else
6262
// expected-error@#10 {{'operator delete' cannot take a dependent type as first parameter; use 'void *'}}
6363
#endif

0 commit comments

Comments
 (0)