]> granicus.if.org Git - clang/commitdiff
[modules] Make GNUMode a normal language option to fix module compilation.
authorVassil Vassilev <v.g.vassilev@gmail.com>
Mon, 6 Mar 2017 16:54:40 +0000 (16:54 +0000)
committerVassil Vassilev <v.g.vassilev@gmail.com>
Mon, 6 Mar 2017 16:54:40 +0000 (16:54 +0000)
GNUMode shouldn't be a benign language option because it influences the
resulting AST when checking for the existence of GNUMode-specific macro
"linux" (e.g. by having code inside #ifdef linux). This patch marks it as a
normal language option so it gets correctly passed to the compiler invocation
for the used modules.

The added test case illustrated this because it compiles without modules, but
fails when using modules.

Patch by Raphael Isemann (D30496)!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@297030 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/Basic/LangOptions.def

index d02909eb07ecc33b8d8be7cea24e77a918100b04..71262755030708f54083118225be8002e1d7838b 100644 (file)
@@ -107,7 +107,7 @@ LANGOPT(WChar             , 1, CPlusPlus, "wchar_t keyword")
 LANGOPT(DeclSpecKeyword   , 1, 0, "__declspec keyword")
 BENIGN_LANGOPT(DollarIdents   , 1, 1, "'$' in identifiers")
 BENIGN_LANGOPT(AsmPreprocessor, 1, 0, "preprocessor in asm mode")
-BENIGN_LANGOPT(GNUMode        , 1, 1, "GNU extensions")
+LANGOPT(GNUMode           , 1, 1, "GNU extensions")
 LANGOPT(GNUKeywords       , 1, 1, "GNU keywords")
 BENIGN_LANGOPT(ImplicitInt, 1, !C99 && !CPlusPlus, "C89 implicit 'int'")
 LANGOPT(Digraphs          , 1, 0, "digraphs")