Skip to content

Commit 1a5b476

Browse files
committed
Revert "[clang] Revert default behavior change of P0522R0 implementation (#91811)"
With blocking issues fixed, re-enable relaxed template template argument matching by reverting these commits. This reverts commit 4198aeb. This reverts commit 2d5634a.
1 parent 8ef2011 commit 1a5b476

File tree

4 files changed

+14
-14
lines changed

4 files changed

+14
-14
lines changed

clang/lib/Driver/ToolChains/Clang.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7249,15 +7249,15 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
72497249
Args.addOptOutFlag(CmdArgs, options::OPT_fassume_unique_vtables,
72507250
options::OPT_fno_assume_unique_vtables);
72517251

7252-
// -fno-relaxed-template-template-args is deprecated.
7253-
if (Arg *A = Args.getLastArg(options::OPT_frelaxed_template_template_args,
7254-
options::OPT_fno_relaxed_template_template_args);
7255-
A &&
7256-
A->getOption().matches(options::OPT_fno_relaxed_template_template_args))
7252+
// -frelaxed-template-template-args is deprecated.
7253+
if (Arg *A =
7254+
Args.getLastArg(options::OPT_frelaxed_template_template_args,
7255+
options::OPT_fno_relaxed_template_template_args)) {
72577256
D.Diag(diag::warn_drv_deprecated_arg)
72587257
<< A->getAsString(Args) << /*hasReplacement=*/false;
7259-
else
7260-
CmdArgs.push_back("-fno-relaxed-template-template-args");
7258+
if (A->getOption().matches(options::OPT_fno_relaxed_template_template_args))
7259+
CmdArgs.push_back("-fno-relaxed-template-template-args");
7260+
}
72617261

72627262
// -fsized-deallocation is off by default, as it is an ABI-breaking change for
72637263
// most platforms.
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// RUN: %clang -fsyntax-only -### %s 2>&1 | FileCheck --check-prefix=CHECK-DEF %s
2-
// RUN: %clang -fsyntax-only -frelaxed-template-template-args %s 2>&1 | FileCheck --check-prefix=CHECK-ON --allow-empty %s
2+
// RUN: %clang -fsyntax-only -frelaxed-template-template-args %s 2>&1 | FileCheck --check-prefix=CHECK-ON %s
33
// RUN: %clang -fsyntax-only -fno-relaxed-template-template-args %s 2>&1 | FileCheck --check-prefix=CHECK-OFF %s
44

5-
// CHECK-DEF: "-cc1"{{.*}} "-fno-relaxed-template-template-args"
6-
// CHECK-ON-NOT: warning: argument '-frelaxed-template-template-args' is deprecated [-Wdeprecated]
5+
// CHECK-DEF-NOT: "-cc1"{{.*}} "-fno-relaxed-template-template-args"
6+
// CHECK-ON: warning: argument '-frelaxed-template-template-args' is deprecated [-Wdeprecated]
77
// CHECK-OFF: warning: argument '-fno-relaxed-template-template-args' is deprecated [-Wdeprecated]

clang/test/Driver/rewrite-legacy-objc.m

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33
// TEST0: "-cc1"
44
// TEST0: "-rewrite-objc"
55
// FIXME: CHECK-NOT is broken somehow, it doesn't work here. Check adjacency instead.
6-
// TEST0: "-stack-protector" "1" "-fblocks" "-fencode-extended-block-signature" "-fregister-global-dtors-with-atexit" "-fgnuc-version=4.2.1"{{.*}} "-fobjc-runtime=macosx-fragile" "-fno-objc-infer-related-result-type" "-fobjc-exceptions" "-fexceptions" "-fno-relaxed-template-template-args" "-fmax-type-align=16"
6+
// TEST0: "-stack-protector" "1" "-fblocks" "-fencode-extended-block-signature" "-fregister-global-dtors-with-atexit" "-fgnuc-version=4.2.1"{{.*}} "-fobjc-runtime=macosx-fragile" "-fno-objc-infer-related-result-type" "-fobjc-exceptions" "-fexceptions" "-fmax-type-align=16"
77
// TEST0: rewrite-legacy-objc.m"
88
// RUN: %clang --target=i386-apple-macosx10.9.0 -rewrite-legacy-objc %s -o - -### 2>&1 | \
99
// RUN: FileCheck -check-prefix=TEST1 %s
1010
// RUN: %clang --target=i386-apple-macosx10.6.0 -rewrite-legacy-objc %s -o - -### 2>&1 | \
1111
// RUN: FileCheck -check-prefix=TEST2 %s
12-
// TEST1: "-stack-protector" "1" "-fblocks" "-fencode-extended-block-signature" "-fregister-global-dtors-with-atexit" "-fgnuc-version=4.2.1"{{.*}} "-fobjc-runtime=macosx-fragile" "-fobjc-subscripting-legacy-runtime" "-fno-objc-infer-related-result-type" "-fobjc-exceptions" "-fno-relaxed-template-template-args" "-fmax-type-align=16"
13-
// TEST2: "-stack-protector" "1" "-fblocks" "-fencode-extended-block-signature" "-fregister-global-dtors-with-atexit" "-fgnuc-version=4.2.1"{{.*}} "-fobjc-runtime=macosx-fragile" "-fobjc-subscripting-legacy-runtime" "-fno-objc-infer-related-result-type" "-fobjc-exceptions" "-fno-relaxed-template-template-args" "-fmax-type-align=16"
12+
// TEST1: "-stack-protector" "1" "-fblocks" "-fencode-extended-block-signature" "-fregister-global-dtors-with-atexit" "-fgnuc-version=4.2.1"{{.*}} "-fobjc-runtime=macosx-fragile" "-fobjc-subscripting-legacy-runtime" "-fno-objc-infer-related-result-type" "-fobjc-exceptions" "-fmax-type-align=16"
13+
// TEST2: "-stack-protector" "1" "-fblocks" "-fencode-extended-block-signature" "-fregister-global-dtors-with-atexit" "-fgnuc-version=4.2.1"{{.*}} "-fobjc-runtime=macosx-fragile" "-fobjc-subscripting-legacy-runtime" "-fno-objc-infer-related-result-type" "-fobjc-exceptions" "-fmax-type-align=16"

clang/test/Driver/rewrite-objc.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
// RUN: FileCheck -check-prefix=TEST0 %s
33
// TEST0: "-cc1" {{.*}} "-rewrite-objc"
44
// FIXME: CHECK-NOT is broken somehow, it doesn't work here. Check adjacency instead.
5-
// TEST0: "-stack-protector" "1" "-fblocks" "-fencode-extended-block-signature" "-fregister-global-dtors-with-atexit" "-fgnuc-version=4.2.1"{{.*}} "-fobjc-runtime=macosx" "-fno-objc-infer-related-result-type" "-fobjc-exceptions" "-fexceptions" "-fno-relaxed-template-template-args" "-fmax-type-align=16"
5+
// TEST0: "-stack-protector" "1" "-fblocks" "-fencode-extended-block-signature" "-fregister-global-dtors-with-atexit" "-fgnuc-version=4.2.1"{{.*}} "-fobjc-runtime=macosx" "-fno-objc-infer-related-result-type" "-fobjc-exceptions" "-fexceptions" "-fmax-type-align=16"

0 commit comments

Comments
 (0)