Continue to instantiate sub-statements in a CompoundStmt as long as
we don't see a DeclStmt (failure to instantiate which generally causes
panic).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112282 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/SemaTemplate/instantiate-clang.cpp b/test/SemaTemplate/instantiate-clang.cpp
index cef2b70..34d68c4 100644
--- a/test/SemaTemplate/instantiate-clang.cpp
+++ b/test/SemaTemplate/instantiate-clang.cpp
@@ -24,7 +24,7 @@
struct ShuffleVector0 {
void f(T t, U u, double2 a, double2 b) {
(void)__builtin_shufflevector(t, u, N, M); // expected-error{{index}}
- (void)__builtin_shufflevector(a, b, N, M);
+ (void)__builtin_shufflevector(a, b, N, M); // expected-error{{index}}
(void)__builtin_shufflevector(a, b, 2, 1);
}
};
diff --git a/test/SemaTemplate/instantiate-expr-3.cpp b/test/SemaTemplate/instantiate-expr-3.cpp
index d506b19..ca88b00 100644
--- a/test/SemaTemplate/instantiate-expr-3.cpp
+++ b/test/SemaTemplate/instantiate-expr-3.cpp
@@ -63,7 +63,11 @@
template<typename T>
struct StatementExpr0 {
void f(T t) {
- (void)({ if (t) t = t + 17; t + 12;}); // expected-error{{contextually convertible}}
+ (void)({
+ if (t) // expected-error{{contextually convertible}}
+ t = t + 17;
+ t + 12; // expected-error{{invalid operands}}
+ });
}
};
@@ -106,8 +110,8 @@
VaList va;
__builtin_va_start(va, n); // expected-error{{int}}
for (int i = 0; i != n; ++i)
- (void)__builtin_va_arg(va, ArgType);
- __builtin_va_end(va);
+ (void)__builtin_va_arg(va, ArgType); // expected-error{{int}}
+ __builtin_va_end(va); // expected-error{{int}}
}
};
diff --git a/test/SemaTemplate/instantiate-expr-4.cpp b/test/SemaTemplate/instantiate-expr-4.cpp
index 8cd7342..adae1da 100644
--- a/test/SemaTemplate/instantiate-expr-4.cpp
+++ b/test/SemaTemplate/instantiate-expr-4.cpp
@@ -115,7 +115,7 @@
struct Delete0 {
void f(T t) {
delete t; // expected-error{{cannot delete}}
- ::delete [] t;
+ ::delete [] t; // expected-error{{cannot delete}}
}
};
diff --git a/test/SemaTemplate/instantiate-function-1.cpp b/test/SemaTemplate/instantiate-function-1.cpp
index a293e9a..651c02c 100644
--- a/test/SemaTemplate/instantiate-function-1.cpp
+++ b/test/SemaTemplate/instantiate-function-1.cpp
@@ -72,7 +72,7 @@
if (T x = t) {
t = x;
}
- return v;
+ return v; // expected-error{{cannot initialize return object of type}}
}
};
@@ -178,10 +178,10 @@
prior:
T prior_label;
- prior_label = &&prior;
+ prior_label = &&prior; // expected-error{{assigning to 'int'}}
T later_label;
- later_label = &&later;
+ later_label = &&later; // expected-error{{assigning to 'int'}}
later:
(void)(1+1);