diff options
-rw-r--r-- | lib/Parse/MinimalAction.cpp | 2 | ||||
-rw-r--r-- | test/Parser/types.c | 10 |
2 files changed, 10 insertions, 2 deletions
diff --git a/lib/Parse/MinimalAction.cpp b/lib/Parse/MinimalAction.cpp index fbda832836..776d701c32 100644 --- a/lib/Parse/MinimalAction.cpp +++ b/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/test/Parser/types.c b/test/Parser/types.c index 69d7eb7105..2131ab0346 100644 --- a/test/Parser/types.c +++ b/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; +} + |