[PATCH] D25942: Fix crash in implicit default constructor creation for a template record specialization that has a field declaration with an initializer expression

Alex Lorenz via cfe-commits cfe-commits at lists.llvm.org
Thu Oct 27 07:39:50 PDT 2016


arphaman added inline comments.


================
Comment at: lib/AST/DeclCXX.cpp:1350
       while (auto *NewCTD = CTD->getInstantiatedFromMemberTemplate()) {
-        if (NewCTD->isMemberSpecialization())
+        if (NewCTD->isMemberSpecialization() ||
+            !NewCTD->isThisDeclarationADefinition())
----------------
rsmith wrote:
> We should be stopping at `A<int>::Inner` because it's a member specialization; whether the primary template had a declaration or a definition is irrelevant. It looks like the problem is that the member specialization check is checking the wrong declaration; we should be checking `CTD` not `NewCTD` here.
Yes, you're right. Thanks for pointing me in the right direction!


Repository:
  rL LLVM

https://reviews.llvm.org/D25942





More information about the cfe-commits mailing list