r227556 - Sema: Disable template instantiation once a fatal error is raised

Nico Weber thakis at chromium.org
Fri Jan 30 09:17:54 PST 2015


This also fixed a truckload of stuff on
http://sli.dy.fi/~sliedes/clang-triage/triage_report.xhtml#changes (Run
#1241).

On Thu, Jan 29, 2015 at 9:01 PM, David Majnemer <david.majnemer at gmail.com>
wrote:

> Author: majnemer
> Date: Thu Jan 29 23:01:23 2015
> New Revision: 227556
>
> URL: http://llvm.org/viewvc/llvm-project?rev=227556&view=rev
> Log:
> Sema: Disable template instantiation once a fatal error is raised
>
> Fatal errors disable all further diagnostics.  Continuing to permit
> template instantiation does nothing but make it take longer for clang to
> finish with the TU.
>
> Instead, halt all further instantiation.
>
> Fixed in PR22396.
>
> Modified:
>     cfe/trunk/lib/Sema/SemaTemplateInstantiate.cpp
>
> Modified: cfe/trunk/lib/Sema/SemaTemplateInstantiate.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaTemplateInstantiate.cpp?rev=227556&r1=227555&r2=227556&view=diff
>
> ==============================================================================
> --- cfe/trunk/lib/Sema/SemaTemplateInstantiate.cpp (original)
> +++ cfe/trunk/lib/Sema/SemaTemplateInstantiate.cpp Thu Jan 29 23:01:23 2015
> @@ -207,6 +207,12 @@ void Sema::InstantiatingTemplate::Initia
>      sema::TemplateDeductionInfo *DeductionInfo) {
>    SavedInNonInstantiationSFINAEContext =
>        SemaRef.InNonInstantiationSFINAEContext;
> +  // Don't allow further instantiation if a fatal error has occcured.  Any
> +  // diagnostics we might have raised will not be visible.
> +  if (SemaRef.Diags.hasFatalErrorOccurred()) {
> +    Invalid = true;
> +    return;
> +  }
>    Invalid = CheckInstantiationDepth(PointOfInstantiation,
> InstantiationRange);
>    if (!Invalid) {
>      ActiveTemplateInstantiation Inst;
>
>
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20150130/c175a7c4/attachment.html>


More information about the cfe-commits mailing list