/// By default, performs semantic analysis to build the new expression.
/// Subclasses may override this routine to provide different behavior.
ExprResult RebuildInitList(SourceLocation LBraceLoc,
- MultiExprArg Inits,
- SourceLocation RBraceLoc,
- QualType ResultTy) {
+ MultiExprArg Inits,
+ SourceLocation RBraceLoc,
+ QualType ResultTy) {
ExprResult Result
= SemaRef.ActOnInitList(LBraceLoc, move(Inits), RBraceLoc);
if (Result.isInvalid() || ResultTy->isDependentType())
Outputs.push_back(Out.get());
continue;
}
+
+ // Record right away that the argument was changed. This needs
+ // to happen even if the array expands to nothing.
+ if (ArgChanged) *ArgChanged = true;
// The transform has determined that we should perform an elementwise
// expansion of the pattern. Do so.
return true;
}
- if (ArgChanged)
- *ArgChanged = true;
Outputs.push_back(Out.get());
}
// CHECK: ret i32 3
template int get_num_types(int, float, double);
+// PR10260 - argument packs that expand to nothing
+namespace test1 {
+ template <class... T> void foo() {
+ int values[sizeof...(T)+1] = { T::value... };
+ // CHECK: define linkonce_odr void @_ZN5test13fooIJEEEvv()
+ // CHECK: alloca [1 x i32], align 4
+ }
+ void test() {
+ foo<>();
+ }
+}