From: Vassil Vassilev Date: Tue, 5 Jan 2021 08:11:33 +0000 (+0000) Subject: Inform the consumer on invalid template instantiations. X-Git-Tag: llvmorg-13-init~2113 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=02eb8e20b51b3ea263bbfe696241b8541c72ee7a;p=platform%2Fupstream%2Fllvm.git Inform the consumer on invalid template instantiations. Some clients which want to track state need the information whether a template was instantiated and made invalid. Differential revision: https://reviews.llvm.org/D92248 --- diff --git a/clang/lib/Sema/SemaTemplateInstantiate.cpp b/clang/lib/Sema/SemaTemplateInstantiate.cpp index 39ea9e0..7e0cc2d 100644 --- a/clang/lib/Sema/SemaTemplateInstantiate.cpp +++ b/clang/lib/Sema/SemaTemplateInstantiate.cpp @@ -2846,8 +2846,6 @@ Sema::InstantiateClass(SourceLocation PointOfInstantiation, SavedContext.pop(); if (!Instantiation->isInvalidDecl()) { - Consumer.HandleTagDeclDefinition(Instantiation); - // Always emit the vtable for an explicit instantiation definition // of a polymorphic class template specialization. Otherwise, eagerly // instantiate only constexpr virtual functions in preparation for their use @@ -2859,6 +2857,8 @@ Sema::InstantiateClass(SourceLocation PointOfInstantiation, /*ConstexprOnly*/ true); } + Consumer.HandleTagDeclDefinition(Instantiation); + return Instantiation->isInvalidDecl(); }