From: Chris Lattner Date: Tue, 24 Mar 2009 17:05:27 +0000 (+0000) Subject: fix "Comment#1" from PR3872 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f26d510f49ddcd1a35e4e9af8978c5b6cb7099c2;p=clang fix "Comment#1" from PR3872 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67625 91177308-0d34-0410-b5e6-96231b3b80d8 --- 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(); - new (TI) TypeNameInfo(1, II->getFETokenInfo()); + new (TI) TypeNameInfo(isTypename, II->getFETokenInfo()); 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; +} +