summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/Decl.cpp
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2019-05-21 20:10:50 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2019-05-21 20:10:50 +0000
commitb2997f579a8b6552a49eab97e33c437b9251eb0a (patch)
tree73c1636810d5a9a7b8d5e9af36cd2c6ab0182eac /clang/lib/AST/Decl.cpp
parent6e19543a2a2013bd357eb15e383b435cd0cbb810 (diff)
downloadbcm5719-llvm-b2997f579a8b6552a49eab97e33c437b9251eb0a.tar.gz
bcm5719-llvm-b2997f579a8b6552a49eab97e33c437b9251eb0a.zip
[c++20] P0780R2: Support pack-expansion of init-captures.
This permits an init-capture to introduce a new pack: template<typename ...T> auto x = [...a = T()] { /* a is a pack */ }; To support this, the mechanism for allowing ParmVarDecls to be packs has been extended to support arbitrary local VarDecls. llvm-svn: 361300
Diffstat (limited to 'clang/lib/AST/Decl.cpp')
-rw-r--r--clang/lib/AST/Decl.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/clang/lib/AST/Decl.cpp b/clang/lib/AST/Decl.cpp
index 4e42dd7d3bd..bc0a5a4c67e 100644
--- a/clang/lib/AST/Decl.cpp
+++ b/clang/lib/AST/Decl.cpp
@@ -2397,6 +2397,10 @@ bool VarDecl::checkInitIsICE() const {
return Eval->IsICE;
}
+bool VarDecl::isParameterPack() const {
+ return isa<PackExpansionType>(getType());
+}
+
template<typename DeclT>
static DeclT *getDefinitionOrSelf(DeclT *D) {
assert(D);
@@ -2683,10 +2687,6 @@ bool ParmVarDecl::hasDefaultArg() const {
!Init.isNull();
}
-bool ParmVarDecl::isParameterPack() const {
- return isa<PackExpansionType>(getType());
-}
-
void ParmVarDecl::setParameterIndexLarge(unsigned parameterIndex) {
getASTContext().setParameterIndex(this, parameterIndex);
ParmVarDeclBits.ParameterIndex = ParameterIndexSentinel;
OpenPOWER on IntegriCloud