forked from OSchip/llvm-project
Allow us to transform pack expansion expressions.
llvm-svn: 123349
This commit is contained in:
parent
fd4344b5a6
commit
0f836ea213
|
@ -6787,8 +6787,14 @@ TreeTransform<Derived>::TransformCXXNoexceptExpr(CXXNoexceptExpr *E) {
|
|||
template<typename Derived>
|
||||
ExprResult
|
||||
TreeTransform<Derived>::TransformPackExpansionExpr(PackExpansionExpr *E) {
|
||||
llvm_unreachable("pack expansion expression in unhandled context");
|
||||
return ExprError();
|
||||
ExprResult Pattern = getDerived().TransformExpr(E->getPattern());
|
||||
if (Pattern.isInvalid())
|
||||
return ExprError();
|
||||
|
||||
if (!getDerived().AlwaysRebuild() && Pattern.get() == E->getPattern())
|
||||
return SemaRef.Owned(E);
|
||||
|
||||
return getDerived().RebuildPackExpansion(Pattern.get(), E->getEllipsisLoc());
|
||||
}
|
||||
|
||||
template<typename Derived>
|
||||
|
|
|
@ -56,4 +56,20 @@ namespace rdar8848837 {
|
|||
|
||||
X<int(float, double)> xif;
|
||||
|
||||
template<unsigned> struct unsigned_c { };
|
||||
template<typename ...ArgTypes> int g(ArgTypes...);
|
||||
|
||||
template<typename F> struct X1;
|
||||
|
||||
template<typename R, typename ...ArgTypes>
|
||||
struct X1<R(ArgTypes...)> {
|
||||
unsigned_c<sizeof(1 + g(ArgTypes()...))> f();
|
||||
};
|
||||
|
||||
template<typename R, typename ...ArgTypes>
|
||||
unsigned_c<sizeof(1 + g(ArgTypes()...))> X1<R(ArgTypes...)>::f() {
|
||||
return unsigned_c<sizeof(int)>();
|
||||
}
|
||||
|
||||
X1<int(float, double)> xif2;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue