diff options
author | Kaelyn Uhrain <rikka@google.com> | 2011-10-11 01:02:41 +0000 |
---|---|---|
committer | Kaelyn Uhrain <rikka@google.com> | 2011-10-11 01:02:41 +0000 |
commit | fac9467d1676dc05761e12e41e13e01a3a3da52b (patch) | |
tree | 12fc43c9043270ebfd6db7342c4c8d1ae1f34f8b /test/SemaCXX/missing-namespace-qualifier-typo-corrections.cpp | |
parent | e1e7862586b6077a68dea05bcdbb67f63be3057d (diff) |
Add typo correction for type names.
The main motivation was to do typo correction in C++ "new" statements,
though picking it up in other places where type names are expected was
pretty much a freebie.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141621 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.cpp | 12 |
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'?}} } |