[cfe-commits] r67625 - in /cfe/trunk: lib/Parse/MinimalAction.cpp test/Parser/types.c

Chris Lattner sabre at nondot.org
Tue Mar 24 10:05:27 PDT 2009


Author: lattner
Date: Tue Mar 24 12:05:27 2009
New Revision: 67625

URL: http://llvm.org/viewvc/llvm-project?rev=67625&view=rev
Log:
fix "Comment#1" from PR3872

Modified:
    cfe/trunk/lib/Parse/MinimalAction.cpp
    cfe/trunk/test/Parser/types.c

Modified: cfe/trunk/lib/Parse/MinimalAction.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/MinimalAction.cpp?rev=67625&r1=67624&r2=67625&view=diff

==============================================================================
--- cfe/trunk/lib/Parse/MinimalAction.cpp (original)
+++ cfe/trunk/lib/Parse/MinimalAction.cpp Tue Mar 24 12:05:27 2009
@@ -74,7 +74,7 @@
     
     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);
     }
     

Modified: cfe/trunk/test/Parser/types.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Parser/types.c?rev=67625&r1=67624&r2=67625&view=diff

==============================================================================
--- cfe/trunk/test/Parser/types.c (original)
+++ cfe/trunk/test/Parser/types.c Tue Mar 24 12:05:27 2009
@@ -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;
+}
+





More information about the cfe-commits mailing list