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

Richard Smith via cfe-commits cfe-commits at lists.llvm.org
Thu Oct 27 00:28:14 PDT 2016


rsmith added inline comments.


================
Comment at: lib/AST/DeclCXX.cpp:1350
       while (auto *NewCTD = CTD->getInstantiatedFromMemberTemplate()) {
-        if (NewCTD->isMemberSpecialization())
+        if (NewCTD->isMemberSpecialization() ||
+            !NewCTD->isThisDeclarationADefinition())
----------------
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.


Repository:
  rL LLVM

https://reviews.llvm.org/D25942





More information about the cfe-commits mailing list