aboutsummaryrefslogtreecommitdiff
path: root/lib/AST/Type.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2011-01-11 01:52:23 +0000
committerDouglas Gregor <dgregor@apple.com>2011-01-11 01:52:23 +0000
commit7d5c0c1273bdc1cb3dff1cb5a62d07b1439e82c7 (patch)
tree978f21cec876212e836022e75a4d1708d5aa4e88 /lib/AST/Type.cpp
parent4d484a753f38a231e17c364cba496f8c6d2d771e (diff)
Implement the last bullet of [temp.deduct.type]p5 and part of the last
sentence of [temp.deduct.call]p1, both of which concern the non-deducibility of parameter packs not at the end of a parameter-type-list. The latter isn't fully implemented yet; see the new FIXME. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123210 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/Type.cpp')
-rw-r--r--lib/AST/Type.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/AST/Type.cpp b/lib/AST/Type.cpp
index 708c344bc7..cc0d7f16e7 100644
--- a/lib/AST/Type.cpp
+++ b/lib/AST/Type.cpp
@@ -1144,7 +1144,11 @@ FunctionProtoType::FunctionProtoType(QualType result, const QualType *args,
}
bool FunctionProtoType::isTemplateVariadic() const {
- return getNumArgs() && isa<PackExpansionType>(getArgType(getNumArgs() - 1));
+ for (unsigned ArgIdx = getNumArgs(); ArgIdx; --ArgIdx)
+ if (isa<PackExpansionType>(getArgType(ArgIdx - 1)))
+ return true;
+
+ return false;
}
void FunctionProtoType::Profile(llvm::FoldingSetNodeID &ID, QualType Result,