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 | f26d510f49ddcd1a35e4e9af8978c5b6cb7099c2 (patch) | |
tree | 0f65598319f0600e72b78bec4e3d4d79fbf95983 | |
parent | f919bfe282b8a94d956290dc9812b456fa2b447e (diff) |
fix "Comment#1" from PR3872
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67625 91177308-0d34-0410-b5e6-96231b3b80d8
-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; +} + |