diff options
author | Douglas Gregor <dgregor@apple.com> | 2011-04-27 04:48:22 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2011-04-27 04:48:22 +0000 |
commit | 8b02cd0beae6e38273afb9d339489f6bb59b8bde (patch) | |
tree | a6d3229f872d0d9cac8039d0283c4ebbd509f82f /clang/test/FixIt/typo.cpp | |
parent | c5d3ba1aad51caed70e0f2e6e52fe6d4436bcae4 (diff) | |
download | bcm5719-llvm-8b02cd0beae6e38273afb9d339489f6bb59b8bde.tar.gz bcm5719-llvm-8b02cd0beae6e38273afb9d339489f6bb59b8bde.zip |
Extend Sema::ClassifyName() to support C++, ironing out a few issues
in the classification of template names and using declarations. We now
properly typo-correct the leading identifiers in statements to types,
templates, values, etc. As an added bonus, this reduces the number of
lookups required for disambiguation.
llvm-svn: 130288
Diffstat (limited to 'clang/test/FixIt/typo.cpp')
-rw-r--r-- | clang/test/FixIt/typo.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/clang/test/FixIt/typo.cpp b/clang/test/FixIt/typo.cpp index 440db455189..f8b5352374f 100644 --- a/clang/test/FixIt/typo.cpp +++ b/clang/test/FixIt/typo.cpp @@ -65,3 +65,12 @@ struct Derived : public Base { // expected-note{{base class 'Base' specified her int &Derived::getMember() { return ember; // expected-error{{use of undeclared identifier 'ember'; did you mean 'member'?}} } + +typedef int Integer; // expected-note{{'Integer' declared here}} +int global_value; // expected-note{{'global_value' declared here}} + +int foo() { + integer * i = 0; // expected-error{{unknown type name 'integer'; did you mean 'Integer'?}} + unsinged *ptr = 0; // expected-error{{use of undeclared identifier 'unsinged'; did you mean 'unsigned'?}} + return *i + *ptr + global_val; // expected-error{{use of undeclared identifier 'global_val'; did you mean 'global_value'?}} +} |