[PATCH] D32435: clang-cl: Add support for /permissive-
Nico Weber via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Mon Apr 24 07:58:09 PDT 2017
thakis created this revision.
https://blogs.msdn.microsoft.com/vcblog/2016/11/16/permissive-switch/ makes it sound like this is similar to -pedantic, which we currently don't expose from clang-cl. So map it to that for now and see how that feels in practice.
Looks like cl.exe only has a flag for /permissive-, but no explicit flag for /permissive (the default).
https://reviews.llvm.org/D32435
Files:
include/clang/Driver/CLCompatOptions.td
test/Driver/cl-options.c
Index: test/Driver/cl-options.c
===================================================================
--- test/Driver/cl-options.c
+++ test/Driver/cl-options.c
@@ -180,6 +180,9 @@
// RUN: %clang_cl --target=i686-pc-win32 -Werror /Oy- -### -- %s 2>&1 | FileCheck -check-prefix=Oy_ %s
// Oy_: -mdisable-fp-elim
+// RUN: %clang_cl /permissive- --target=i686-pc-windows-msvc -### -- %s 2>&1 | FileCheck -check-prefix=permissive_ %s
+// permissive_: -pedantic
+
// RUN: %clang_cl /Qvec -### -- %s 2>&1 | FileCheck -check-prefix=Qvec %s
// Qvec: -vectorize-loops
Index: include/clang/Driver/CLCompatOptions.td
===================================================================
--- include/clang/Driver/CLCompatOptions.td
+++ include/clang/Driver/CLCompatOptions.td
@@ -111,6 +111,8 @@
AliasArgs<["s"]>;
def _SLASH_Ot : CLFlag<"Ot">, HelpText<"Optimize for speed">, Alias<O>,
AliasArgs<["2"]>;
+def _SLASH_permissive_ : CLFlag<"permissive-">, Alias<pedantic>,
+ HelpText<"Diagnose use of nonstandard language extensions">;
def _SLASH_QUESTION : CLFlag<"?">, Alias<help>,
HelpText<"Display available options">;
def _SLASH_Qvec : CLFlag<"Qvec">,
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D32435.96398.patch
Type: text/x-patch
Size: 1157 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20170424/8efc1c23/attachment-0001.bin>
More information about the cfe-commits
mailing list