summaryrefslogtreecommitdiff
path: root/test/SemaCXX/missing-namespace-qualifier-typo-corrections.cpp
diff options
context:
space:
mode:
authorKaelyn Uhrain <rikka@google.com>2011-09-27 00:33:13 +0000
committerKaelyn Uhrain <rikka@google.com>2011-09-27 00:33:13 +0000
commit93476ddd9ce490f9c08d78b640efad812cb019d1 (patch)
tree30aebc00753c07010f7eea77ef5226b69a00a990 /test/SemaCXX/missing-namespace-qualifier-typo-corrections.cpp
parent671436e9e2794c56f3c2e62739d225571493af37 (diff)
downloadclang-93476ddd9ce490f9c08d78b640efad812cb019d1.tar.gz
Add typo correction for the type name in C++ "new" statements
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140589 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/SemaCXX/missing-namespace-qualifier-typo-corrections.cpp')
-rw-r--r--test/SemaCXX/missing-namespace-qualifier-typo-corrections.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/test/SemaCXX/missing-namespace-qualifier-typo-corrections.cpp b/test/SemaCXX/missing-namespace-qualifier-typo-corrections.cpp
index 85e3e7ed08..76ceea1d4d 100644
--- a/test/SemaCXX/missing-namespace-qualifier-typo-corrections.cpp
+++ b/test/SemaCXX/missing-namespace-qualifier-typo-corrections.cpp
@@ -1,8 +1,10 @@
// RUN: %clang_cc1 -fsyntax-only -verify -Wno-c++0x-extensions %s
-namespace fizbin { class Foobar; } // expected-note{{'fizbin::Foobar' declared here}}
+namespace fizbin { class Foobar {}; } // expected-note 2 {{'fizbin::Foobar' declared here}} \
+ // expected-note {{'Foobar' declared here}}
Foobar *my_bar // expected-error{{unknown type name 'Foobar'; did you mean 'fizbin::Foobar'?}}
- = new Foobar; // expected-error{{expected a type}}
+ = new Foobar; // expected-error{{unknown type name 'Foobar'; did you mean 'fizbin::Foobar'?}}
+fizbin::Foobar *my_foo = new fizbin::FooBar; // expected-error{{unknown type name 'FooBar'; did you mean 'Foobar'?}}
namespace barstool { int toFoobar() { return 1; } } // expected-note 3 {{'barstool::toFoobar' declared here}}
int Double(int x) { return x + x; }
@@ -62,11 +64,13 @@ void f() {
// Test case from http://llvm.org/bugs/show_bug.cgi?id=10318
namespace llvm {
- template <typename T> class GraphWriter {}; // expected-note{{'llvm::GraphWriter' declared here}}
+ template <typename T> class GraphWriter {}; // expected-note {{'llvm::GraphWriter' declared here}} \
+ // expected-note {{'GraphWriter' declared here}}
}
struct S {};
void bar() {
GraphWriter<S> x; //expected-error{{no template named 'GraphWriter'; did you mean 'llvm::GraphWriter'?}}
-
+ (void)new llvm::GraphWriter; // expected-error {{expected a type}}
+ (void)new llvm::Graphwriter<S>; // expected-error {{no template named 'Graphwriter' in namespace 'llvm'; did you mean 'GraphWriter'?}}
}