]> granicus.if.org Git - clang/commitdiff
fix "Comment#1" from PR3872
authorChris Lattner <sabre@nondot.org>
Tue, 24 Mar 2009 17:05:27 +0000 (17:05 +0000)
committerChris Lattner <sabre@nondot.org>
Tue, 24 Mar 2009 17:05:27 +0000 (17:05 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67625 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Parse/MinimalAction.cpp
test/Parser/types.c

index fbda8328368246d3947157c1c69b8808e4b914cc..776d701c32a839108a3afb17653d57a626cf78f7 100644 (file)
@@ -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);
     }
     
index 69d7eb71054bdefefd1f62826d4371764586a1ef..2131ab0346f4f4c32b177885e150ce2f3a956398 100644 (file)
@@ -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;
+}
+