summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--clang/Driver/clang.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/clang/Driver/clang.cpp b/clang/Driver/clang.cpp
index 303bfe757f5..c9022e4b57c 100644
--- a/clang/Driver/clang.cpp
+++ b/clang/Driver/clang.cpp
@@ -569,8 +569,16 @@ static void InitializeLanguageStandard(LangOptions &Options, LangKind LK,
// Mimicing gcc's behavior, trigraphs are only enabled if -trigraphs or -ansi
// is specified, or -std is set to a conforming mode.
- Options.Trigraphs = LangStd < lang_gnu_START || Trigraphs ? 1 : 0;
-
+ Options.Trigraphs = LangStd < lang_gnu_START;
+ if (Trigraphs.getPosition())
+ Options.Trigraphs = Trigraphs; // Command line option wins.
+
+ // If in a conformant language mode (e.g. -std=c99) Blocks defaults to off
+ // even if they are normally on for the target. In GNU modes (e.g.
+ // -std=gnu99) the default for blocks depends on the target settings.
+ if (LangStd < lang_gnu_START)
+ Options.Blocks = 0;
+
Options.DollarIdents = 1; // FIXME: Really a target property.
if (PascalStrings.getPosition())
Options.PascalStrings = PascalStrings;
OpenPOWER on IntegriCloud