diff options
| author | Chris Lattner <sabre@nondot.org> | 2009-03-24 17:05:27 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2009-03-24 17:05:27 +0000 |
| commit | deab7250fb367def89869a6acd6040f2b01d24b8 (patch) | |
| tree | d5233ac3be7fd6231ba6ccd7166f089d98c89d79 /clang | |
| parent | 803802d4d6351bb665acee4ce09b592af8dd60ee (diff) | |
| download | bcm5719-llvm-deab7250fb367def89869a6acd6040f2b01d24b8.tar.gz bcm5719-llvm-deab7250fb367def89869a6acd6040f2b01d24b8.zip | |
fix "Comment#1" from PR3872
llvm-svn: 67625
Diffstat (limited to 'clang')
| -rw-r--r-- | clang/lib/Parse/MinimalAction.cpp | 2 | ||||
| -rw-r--r-- | clang/test/Parser/types.c | 10 |
2 files changed, 10 insertions, 2 deletions
diff --git a/clang/lib/Parse/MinimalAction.cpp b/clang/lib/Parse/MinimalAction.cpp index fbda8328368..776d701c32a 100644 --- a/clang/lib/Parse/MinimalAction.cpp +++ b/clang/lib/Parse/MinimalAction.cpp @@ -74,7 +74,7 @@ namespace { void AddEntry(bool isTypename, IdentifierInfo *II) { TypeNameInfo *TI = Allocator.Allocate<TypeNameInfo>(); - new (TI) TypeNameInfo(1, II->getFETokenInfo<TypeNameInfo>()); + new (TI) TypeNameInfo(isTypename, II->getFETokenInfo<TypeNameInfo>()); II->setFETokenInfo(TI); } diff --git a/clang/test/Parser/types.c b/clang/test/Parser/types.c index 69d7eb71054..2131ab0346f 100644 --- a/clang/test/Parser/types.c +++ b/clang/test/Parser/types.c @@ -1,6 +1,14 @@ -// RUN: clang-cc %s -fsyntax-only +// RUN: clang-cc %s -parse-noop // Test the X can be overloaded inside the struct. typedef int X; struct Y { short X; }; +// Variable shadows type, PR3872 + +typedef struct foo { int x; } foo; +void test() { + foo *foo; + foo->x = 0; +} + |

