diff options
author | Erich Keane <erich.keane@intel.com> | 2017-05-24 19:31:19 +0000 |
---|---|---|
committer | Erich Keane <erich.keane@intel.com> | 2017-05-24 19:31:19 +0000 |
commit | b28d2ee4c9f291941467723f7c5c48f47b0be951 (patch) | |
tree | 2430198440fd070be8f38bcc7c597c68c9c8e231 /lib/Frontend/CompilerInvocation.cpp | |
parent | 3143081d4afe3c116a7f968e1b26c63b4d9c1938 (diff) | |
download | clang-b28d2ee4c9f291941467723f7c5c48f47b0be951.tar.gz |
For Microsoft compatibility, set fno_operator_names
There's a Microsoft header in the Windows SDK which won't
compile with clang because it uses an operator name (and)
as a field name. This patch allows that file to compile by
setting the option which disables operator names.
The header which doesn't compile <Query.h> C:/Program Files (x86)/
Windows Kits/10/include/10.0.14393.0/um\Query.h:259:40:
error: expected member name or ';' after declaration specifiers
/* [case()] */ NODERESTRICTION or;
~~~~~~~~~~~~~~~ ^
1 error generated.
Contributed for Melanie Blower
Differential Revision:https://reviews.llvm.org/D33505
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@303798 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Frontend/CompilerInvocation.cpp')
-rw-r--r-- | lib/Frontend/CompilerInvocation.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/Frontend/CompilerInvocation.cpp b/lib/Frontend/CompilerInvocation.cpp index 859e8ba18b..071687981a 100644 --- a/lib/Frontend/CompilerInvocation.cpp +++ b/lib/Frontend/CompilerInvocation.cpp @@ -1882,7 +1882,7 @@ static void ParseLangArgs(LangOptions &Opts, ArgList &Args, InputKind IK, Opts.GNUKeywords = Args.hasFlag(OPT_fgnu_keywords, OPT_fno_gnu_keywords, Opts.GNUKeywords); - if (Args.hasArg(OPT_fno_operator_names)) + if (Args.hasArg(OPT_fno_operator_names) || Args.hasArg(OPT_fms_compatibility)) Opts.CXXOperatorNames = 0; if (Args.hasArg(OPT_fcuda_is_device)) |