summaryrefslogtreecommitdiff
path: root/utils
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2017-08-15 22:58:45 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2017-08-15 22:58:45 +0000
commit33face3d0aa48641185e8c7eea4483fe4239cfaf (patch)
tree16b46a2f85906cd0d6fec62069c47b3bbb8c79e2 /utils
parentfb6fcfa4d27a28a5f8a05f23843b1ec55d08ec4b (diff)
Do not look through pack expansions when looking for unexpanded parameter packs.
Fixes a selection of rejects-valids when pack-expanding a lambda that itself contains a pack expansion. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@310972 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'utils')
-rw-r--r--utils/TableGen/ClangAttrEmitter.cpp21
1 files changed, 21 insertions, 0 deletions
diff --git a/utils/TableGen/ClangAttrEmitter.cpp b/utils/TableGen/ClangAttrEmitter.cpp
index b6d2988964..abbef617bb 100644
--- a/utils/TableGen/ClangAttrEmitter.cpp
+++ b/utils/TableGen/ClangAttrEmitter.cpp
@@ -490,6 +490,17 @@ namespace {
OS << "}\n";
}
+ void writeASTVisitorTraversal(raw_ostream &OS) const override {
+ StringRef Name = getUpperName();
+ OS << " if (A->is" << Name << "Expr()) {\n"
+ << " if (!getDerived().TraverseStmt(A->get" << Name << "Expr()))\n"
+ << " return false;\n"
+ << " } else if (auto *TSI = A->get" << Name << "Type()) {\n"
+ << " if (!getDerived().TraverseTypeLoc(TSI->getTypeLoc()))\n"
+ << " return false;\n"
+ << " }\n";
+ }
+
void writeCloneArgs(raw_ostream &OS) const override {
OS << "is" << getLowerName() << "Expr, is" << getLowerName()
<< "Expr ? static_cast<void*>(" << getLowerName()
@@ -630,6 +641,10 @@ namespace {
<< "A->" << getLowerName() << "_size()";
}
+ void writeASTVisitorTraversal(raw_ostream &OS) const override {
+ // FIXME: Traverse the elements.
+ }
+
void writeCtorBody(raw_ostream &OS) const override {
OS << " std::copy(" << getUpperName() << ", " << getUpperName()
<< " + " << ArgSizeName << ", " << ArgName << ");\n";
@@ -1153,6 +1168,12 @@ namespace {
OS << " }";
}
+ void writeASTVisitorTraversal(raw_ostream &OS) const override {
+ OS << " if (auto *TSI = A->get" << getUpperName() << "Loc())\n";
+ OS << " if (!getDerived().TraverseTypeLoc(TSI->getTypeLoc()))\n";
+ OS << " return false;\n";
+ }
+
void writeTemplateInstantiationArgs(raw_ostream &OS) const override {
OS << "A->get" << getUpperName() << "Loc()";
}