diff mbox

ObjC++ - another small parser bugfix merge from apple/trunk

Message ID 1287354887.065618517@192.168.2.228
State New
Headers show

Commit Message

Nicola Pero Oct. 17, 2010, 10:34 p.m. UTC
Another bugfix for the ObjC++ parser (with testcase) merge from the apple/trunk.  Committed to trunk (preapproved by Mike).

Thanks
diff mbox

Patch

Index: gcc/testsuite/ChangeLog
===================================================================
--- gcc/testsuite/ChangeLog     (revision 165601)
+++ gcc/testsuite/ChangeLog     (working copy)
@@ -1,7 +1,16 @@ 
 2010-10-17  Nicola Pero  <nicola.pero@meta-innovation.com>
        
        Merge from 'apple/trunk' branch on FSF servers.
+       
+       2006-04-19 Fariborz Jahanian <fjahanian@apple.com>
 
+       Radar 4516785
+       * obj-c++.dg/method-namespace-2.mm: New.
+       
+2010-10-17  Nicola Pero  <nicola.pero@meta-innovation.com>
+       
+       Merge from 'apple/trunk' branch on FSF servers.
+
        2006-03-27 Fariborz Jahanian <fjahanian@apple.com>
 
        Radar 4133425
Index: gcc/testsuite/obj-c++.dg/method-namespace-2.mm
===================================================================
--- gcc/testsuite/obj-c++.dg/method-namespace-2.mm      (revision 0)
+++ gcc/testsuite/obj-c++.dg/method-namespace-2.mm      (revision 0)
@@ -0,0 +1,25 @@ 
+/* Test that qualified type is resolved to its proper type. */
+/* { dg-do compile } */
+
+@interface  Object 
+{
+       int I[100];
+}
+@end
+
+namespace HC
+{
+
+struct Object
+{
+    void test();
+}; 
+
+} // namespace HC
+
+int main()
+{
+    HC::Object* object;
+    object->test();    // Must compile with no error
+    return 0;
+}
Index: gcc/cp/ChangeLog
===================================================================
--- gcc/cp/ChangeLog    (revision 165601)
+++ gcc/cp/ChangeLog    (working copy)
@@ -1,7 +1,17 @@ 
 2010-10-17  Nicola Pero  <nicola.pero@meta-innovation.com>
        
        Merge from apple/trunk branch on FSF servers.
+
+       2006-04-19 Fariborz Jahanian <fjahanian@apple.com>
+
+        Radar 4516785
+       * parser.c (cp_parser_simple_type_specifier): Don't lookup for
+       objc object types if type is scope qualified.
        
+2010-10-17  Nicola Pero  <nicola.pero@meta-innovation.com>
+       
+       Merge from apple/trunk branch on FSF servers.
+       
        2006-03-27 Fariborz Jahanian <fjahanian@apple.com>
 
         Radar 4133425
Index: gcc/cp/parser.c
===================================================================
--- gcc/cp/parser.c     (revision 165600)
+++ gcc/cp/parser.c     (working copy)
@@ -12753,7 +12753,7 @@  cp_parser_simple_type_specifier (cp_parser* parser
       /* As a last-ditch effort, see if TYPE is an Objective-C type.
         If it is, then the '<'...'>' enclose protocol names rather than
         template arguments, and so everything is fine.  */
-      if (c_dialect_objc ()
+      if (c_dialect_objc () && !parser->scope
          && (objc_is_id (type) || objc_is_class_name (type)))
        {
          tree protos = cp_parser_objc_protocol_refs_opt (parser);