diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Frontend/CompilerInvocation.cpp | 5 | ||||
-rw-r--r-- | lib/Sema/Sema.cpp | 5 | ||||
-rw-r--r-- | lib/Sema/SemaDeclCXX.cpp | 5 |
3 files changed, 6 insertions, 9 deletions
diff --git a/lib/Frontend/CompilerInvocation.cpp b/lib/Frontend/CompilerInvocation.cpp index 7a7692f377..180ce3efcb 100644 --- a/lib/Frontend/CompilerInvocation.cpp +++ b/lib/Frontend/CompilerInvocation.cpp @@ -698,9 +698,6 @@ static void LangOptsToArgs(const LangOptions &Opts, Res.push_back("-fdelayed-template-parsing"); if (Opts.Deprecated) Res.push_back("-fdeprecated-macro"); - - if (Opts.CheckDelegatingCtorCycles) - Res.push_back("-fcheck-delegating-ctor-cycles"); } static void PreprocessorOptsToArgs(const PreprocessorOptions &Opts, @@ -1569,8 +1566,6 @@ static void ParseLangArgs(LangOptions &Opts, ArgList &Args, InputKind IK, Opts.MRTD = Args.hasArg(OPT_mrtd); Opts.FakeAddressSpaceMap = Args.hasArg(OPT_ffake_address_space_map); Opts.ParseUnknownAnytype = Args.hasArg(OPT_funknown_anytype); - Opts.CheckDelegatingCtorCycles - = !Args.hasArg(OPT_fno_check_delegating_ctor_cycles); // Record whether the __DEPRECATED define was requested. Opts.Deprecated = Args.hasFlag(OPT_fdeprecated_macro, diff --git a/lib/Sema/Sema.cpp b/lib/Sema/Sema.cpp index ec2c739228..c47827153d 100644 --- a/lib/Sema/Sema.cpp +++ b/lib/Sema/Sema.cpp @@ -474,7 +474,10 @@ void Sema::ActOnEndOfTranslationUnit() { } - if (LangOpts.CPlusPlus0x && LangOpts.CheckDelegatingCtorCycles) + if (LangOpts.CPlusPlus0x && + Diags.getDiagnosticLevel(diag::warn_delegating_ctor_cycle, + SourceLocation()) + != Diagnostic::Ignored) CheckDelegatingCtorCycles(); // If there were errors, disable 'unused' warnings since they will mostly be diff --git a/lib/Sema/SemaDeclCXX.cpp b/lib/Sema/SemaDeclCXX.cpp index bb732e2c9f..7b28696814 100644 --- a/lib/Sema/SemaDeclCXX.cpp +++ b/lib/Sema/SemaDeclCXX.cpp @@ -2085,8 +2085,7 @@ Sema::SetDelegatingInitializer(CXXConstructorDecl *Constructor, DiagnoseUseOfDecl(Dtor, Initializer->getSourceLocation()); } - if (LangOpts.CheckDelegatingCtorCycles) - DelegatingCtorDecls.push_back(Constructor); + DelegatingCtorDecls.push_back(Constructor); return false; } @@ -7984,7 +7983,7 @@ void DelegatingCycleHelper(CXXConstructorDecl* Ctor, // If we haven't diagnosed this cycle yet, do so now. if (!Invalid.count(TCanonical)) { S.Diag((*Ctor->init_begin())->getSourceLocation(), - diag::err_delegating_ctor_cycle) + diag::warn_delegating_ctor_cycle) << Ctor; // Don't add a note for a function delegating directo to itself. |