aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Frontend/CompilerInvocation.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/Frontend/CompilerInvocation.cpp')
-rw-r--r--clang/lib/Frontend/CompilerInvocation.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/clang/lib/Frontend/CompilerInvocation.cpp b/clang/lib/Frontend/CompilerInvocation.cpp
index f42e28b..0082c15 100644
--- a/clang/lib/Frontend/CompilerInvocation.cpp
+++ b/clang/lib/Frontend/CompilerInvocation.cpp
@@ -610,6 +610,19 @@ static bool FixupInvocation(CompilerInvocation &Invocation,
LangOpts.NewAlignOverride = 0;
}
+ // The -f[no-]raw-string-literals option is only valid in C and in C++
+ // standards before C++11.
+ if (LangOpts.CPlusPlus11) {
+ if (Args.hasArg(OPT_fraw_string_literals, OPT_fno_raw_string_literals)) {
+ Args.claimAllArgs(OPT_fraw_string_literals, OPT_fno_raw_string_literals);
+ Diags.Report(diag::warn_drv_fraw_string_literals_in_cxx11)
+ << bool(LangOpts.RawStringLiterals);
+ }
+
+ // Do not allow disabling raw string literals in C++11 or later.
+ LangOpts.RawStringLiterals = true;
+ }
+
// Prevent the user from specifying both -fsycl-is-device and -fsycl-is-host.
if (LangOpts.SYCLIsDevice && LangOpts.SYCLIsHost)
Diags.Report(diag::err_drv_argument_not_allowed_with) << "-fsycl-is-device"