ctor-initializer, remember to call the Sema action to generate default
ctor-initializers. What a delightful little miscompile. Fixes PR10578
/ <rdar://problem/
9877267>.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139253
91177308-0d34-0410-b5e6-
96231b3b80d8
// Constructor initializer list?
if (Tok.is(tok::colon))
ParseConstructorInitializer(Decl);
-
+ else
+ Actions.ActOnDefaultCtorInitializers(Decl);
+
if (PP.isCodeCompletionEnabled()) {
if (trySkippingFunctionBodyForCodeCompletion()) {
BodyScope.Exit();
struct TypedefInit {
typedef int A = 0; // expected-error {{illegal initializer}}
};
+
+// PR10578 / <rdar://problem/9877267>
+namespace PR10578 {
+ template<typename T>
+ struct X {
+ X() {
+ T* x = 1; // expected-error{{cannot initialize a variable of type 'int *' with an rvalue of type 'int'}}
+ }
+ };
+
+ struct Y : X<int> {
+ Y();
+ };
+
+ Y::Y() try { // expected-note{{in instantiation of member function 'PR10578::X<int>::X' requested here}}
+ } catch(...) {
+ }
+}