diff options
Diffstat (limited to 'lib/Driver/Tools.cpp')
-rw-r--r-- | lib/Driver/Tools.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/Driver/Tools.cpp b/lib/Driver/Tools.cpp index 436a2a42a4..f5dacfa6cf 100644 --- a/lib/Driver/Tools.cpp +++ b/lib/Driver/Tools.cpp @@ -1362,6 +1362,17 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA, CmdArgs.push_back("-fconst-strings"); } + // GCC provides a macro definition '__DEPRECATED' when -Wdeprecated is active + // during C++ compilation. CC1 uses '-fdeprecated-macro' to control this. + // Both '-Wdeprecated' and '-fdeprecated-macro' default to on, so the flag + // logic here is inverted. + if (Args.hasFlag(options::OPT_Wno_deprecated, options::OPT_Wdeprecated, + false)) { + // GCC keeps this define even in the presence of '-w', match this behavior + // bug-for-bug. + CmdArgs.push_back("-fno-deprecated-macro"); + } + // Translate GCC's misnamer '-fasm' arguments to '-fgnu-keywords'. if (Arg *Asm = Args.getLastArg(options::OPT_fasm, options::OPT_fno_asm)) { if (Asm->getOption().matches(options::OPT_fasm)) |