summaryrefslogtreecommitdiffstats
path: root/clang
diff options
context:
space:
mode:
authorHans Wennborg <hans@hanshq.net>2017-04-17 21:28:36 +0000
committerHans Wennborg <hans@hanshq.net>2017-04-17 21:28:36 +0000
commit21793a617ab645faae343519e48bb11ce592c03c (patch)
treebd5d764e6ceb2b7b708ea4544b0863c2e89ed7a4 /clang
parent61d85bc9ae61c1b814a5876116f002daf34f7417 (diff)
downloadbcm5719-llvm-21793a617ab645faae343519e48bb11ce592c03c.tar.gz
bcm5719-llvm-21793a617ab645faae343519e48bb11ce592c03c.zip
clang-cl: Support the /Zc:twoPhase[-] command-line option (PR32680)
It sounds like MSVC is adding support for two-phase name lookup in a future version, enabled by this flag (see bug). Differential Revision: https://reviews.llvm.org/D32138 llvm-svn: 300501
Diffstat (limited to 'clang')
-rw-r--r--clang/include/clang/Driver/CLCompatOptions.td6
-rw-r--r--clang/test/Driver/cl-options.c3
2 files changed, 9 insertions, 0 deletions
diff --git a/clang/include/clang/Driver/CLCompatOptions.td b/clang/include/clang/Driver/CLCompatOptions.td
index 9b6ab3a5ef2..61902653e21 100644
--- a/clang/include/clang/Driver/CLCompatOptions.td
+++ b/clang/include/clang/Driver/CLCompatOptions.td
@@ -172,6 +172,12 @@ def _SLASH_Zc_trigraphs : CLFlag<"Zc:trigraphs">,
HelpText<"Enable trigraphs">, Alias<ftrigraphs>;
def _SLASH_Zc_trigraphs_off : CLFlag<"Zc:trigraphs-">,
HelpText<"Disable trigraphs (default)">, Alias<fno_trigraphs>;
+def _SLASH_Zc_twoPhase : CLFlag<"Zc:twoPhase">,
+ HelpText<"Enable two-phase name lookup in templates">,
+ Alias<fno_delayed_template_parsing>;
+def _SLASH_Zc_twoPhase_ : CLFlag<"Zc:twoPhase-">,
+ HelpText<"Disable two-phase name lookup in templates">,
+ Alias<fdelayed_template_parsing>;
def _SLASH_Z7 : CLFlag<"Z7">,
HelpText<"Enable CodeView debug information in object files">;
def _SLASH_Zd : CLFlag<"Zd">,
diff --git a/clang/test/Driver/cl-options.c b/clang/test/Driver/cl-options.c
index c425e21dd7f..ddfb3cbdc4a 100644
--- a/clang/test/Driver/cl-options.c
+++ b/clang/test/Driver/cl-options.c
@@ -296,11 +296,14 @@
// NOSTRICT: "-relaxed-aliasing"
// We recognize -f[no-]delayed-template-parsing.
+// /Zc:twoPhase[-] has the opposite meaning.
// RUN: %clang_cl -c -### -- %s 2>&1 | FileCheck -check-prefix=DELAYEDDEFAULT %s
// DELAYEDDEFAULT: "-fdelayed-template-parsing"
// RUN: %clang_cl -c -fdelayed-template-parsing -### -- %s 2>&1 | FileCheck -check-prefix=DELAYEDON %s
+// RUN: %clang_cl -c /Zc:twoPhase- -### -- %s 2>&1 | FileCheck -check-prefix=DELAYEDON %s
// DELAYEDON: "-fdelayed-template-parsing"
// RUN: %clang_cl -c -fno-delayed-template-parsing -### -- %s 2>&1 | FileCheck -check-prefix=DELAYEDOFF %s
+// RUN: %clang_cl -c /Zc:twoPhase -### -- %s 2>&1 | FileCheck -check-prefix=DELAYEDOFF %s
// DELAYEDOFF-NOT: "-fdelayed-template-parsing"
// For some warning ids, we can map from MSVC warning to Clang warning.
OpenPOWER on IntegriCloud