summaryrefslogtreecommitdiffstats
path: root/test/SemaCXX/typo-correction-delayed.cpp
diff options
context:
space:
mode:
authorKaelyn Takata <rikka@google.com>2014-11-20 22:06:44 +0000
committerKaelyn Takata <rikka@google.com>2014-11-20 22:06:44 +0000
commitfeea241eacd2e89751d297322fa74c7ce239d2e4 (patch)
tree9ca68cabc0ee1f8eb96ee6d6cd89059a56f0bd34 /test/SemaCXX/typo-correction-delayed.cpp
parentb11b40a67ef9847447d3066fad06698dd9c317d2 (diff)
Ensure all TypoExprs are diagnosed by the tree transform.
If there is more than one TypoExpr within the expr being transformed and any but the last TypoExpr seen don't have any viable candidates, the tree transform will be aborted early and the remaining TypoExprs are never seen and hence never diagnosed. This adds a simple RecursiveASTVisitor to find all of the TypoExprs to be diagnosed in the case where typo correction of the entire expr fails (and the result of the tree transform is an ExprError). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@222465 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/SemaCXX/typo-correction-delayed.cpp')
-rw-r--r--test/SemaCXX/typo-correction-delayed.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/test/SemaCXX/typo-correction-delayed.cpp b/test/SemaCXX/typo-correction-delayed.cpp
index c79fe45629..984d68b6b9 100644
--- a/test/SemaCXX/typo-correction-delayed.cpp
+++ b/test/SemaCXX/typo-correction-delayed.cpp
@@ -42,3 +42,9 @@ public:
void testMemberExpr(Foo *f) {
f->TestIt(); // expected-error {{no member named 'TestIt' in 'Foo'; did you mean 'textIt'?}}
}
+
+void callee(double, double);
+void testNoCandidates() {
+ callee(xxxxxx, // expected-error-re {{use of undeclared identifier 'xxxxxx'{{$}}}}
+ zzzzzz); // expected-error-re {{use of undeclared identifier 'zzzzzz'{{$}}}}
+}