Skip to content

Commit 2d5634a

Browse files
authored
[clang] Revert default behavior change of P0522R0 implementation (#91811)
This partially reverts b86e099. Just the default is changed back, on the Driver side. No Frontend changes. The positive spelling of the flag is undeprecated. No documentation changes or changelog entries because we plan to revert this revert as soon as #62529 is fixed.
1 parent aa0776d commit 2d5634a

File tree

2 files changed

+11
-9
lines changed

2 files changed

+11
-9
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-
// -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)) {
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))
72567257
D.Diag(diag::warn_drv_deprecated_arg)
72577258
<< A->getAsString(Args) << /*hasReplacement=*/false;
7258-
if (A->getOption().matches(options::OPT_fno_relaxed_template_template_args))
7259-
CmdArgs.push_back("-fno-relaxed-template-template-args");
7260-
}
7259+
else
7260+
CmdArgs.push_back("-fno-relaxed-template-template-args");
72617261

72627262
// -fsized-deallocation is off by default, as it is an ABI-breaking change for
72637263
// most platforms.
Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1-
// RUN: %clang -fsyntax-only -frelaxed-template-template-args %s 2>&1 | FileCheck --check-prefix=CHECK-ON %s
1+
// 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
23
// RUN: %clang -fsyntax-only -fno-relaxed-template-template-args %s 2>&1 | FileCheck --check-prefix=CHECK-OFF %s
34

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

0 commit comments

Comments
 (0)