[PATCH] Handle use of default member initializers before end of outermost class

Reid Kleckner rnk at google.com
Mon Nov 17 15:36:41 PST 2014


Thanks!

================
Comment at: lib/Sema/SemaTemplateInstantiate.cpp:2230
@@ +2229,3 @@
+
+  LocalInstantiationScope Scope(*this, /*MergeWithParentScope*/true);
+
----------------
rsmith wrote:
> `MergeWithParentScope` should be `false` here; there's not necessarily any connection between whatever we were instantiating before and this scope.
OK.

================
Comment at: lib/Sema/SemaTemplateInstantiate.cpp:2246
@@ +2245,3 @@
+
+  return Init == nullptr;
+}
----------------
rsmith wrote:
> You currently return `false` even when `ActOnFinishCXXInClassMemberInitializer` fails; you should probably either return `true` in that case or remove your return value and check for whether there actually is an in-class initialzer in the caller afterwards.
I think the Instantiate* methods should all return consistent error codes, so I'd like to keep this. I can do `return !Instantiation->getInClassInitializer()`, though, since that is the error case.

Should I be marking the Instantiation FieldDecl invalid if instantiation fails? Otherwise the next time we hit a constructor I think we'll try to reinstantiate. I'll handle this in a followup commit if you think this is better.

http://reviews.llvm.org/D5690






More information about the cfe-commits mailing list