gengtype: Ignore access-control keywords when parsing fields
authorDavid Malcolm <dmalcolm@redhat.com>
Wed, 16 Oct 2013 15:25:23 +0000 (15:25 +0000)
committerDavid Malcolm <dmalcolm@gcc.gnu.org>
Wed, 16 Oct 2013 15:25:23 +0000 (15:25 +0000)
* gengtype-parse.c (struct_field_seq): Ignore access-control
keywords ("public:" etc).

From-SVN: r203708

gcc/ChangeLog
gcc/gengtype-parse.c

index 6fad912561c69462192646890103c46c9c187eb8..c1617d4ba2452b4a593f7610564d59c5c3952558 100644 (file)
@@ -1,3 +1,8 @@
+2013-10-16  David Malcolm  <dmalcolm@redhat.com>
+
+       * gengtype-parse.c (struct_field_seq): Ignore access-control
+       keywords ("public:" etc).
+
 2013-10-16  Marcus Shawcroft  <marcus.shawcroft@arm.com>
 
        * config/aarch64/aarch64.c (aarch64_regno_regclass): Classify
index 68d372eb6845e646d4cfd2d9096750a981b6701b..e5204c1a71dd84df06663ff0b554f3ca68546097 100644 (file)
@@ -733,6 +733,17 @@ struct_field_seq (void)
     {
       ty = type (&opts, true);
 
+      /* Ignore access-control keywords ("public:" etc).  */
+      while (!ty && token () == IGNORABLE_CXX_KEYWORD)
+       {
+         const char *keyword = advance ();
+         if (strcmp (keyword, "public:") != 0
+             && strcmp (keyword, "private:") != 0
+             && strcmp (keyword, "protected:") != 0)
+           break;
+         ty = type (&opts, true);
+       }
+
       if (!ty || token () == ':')
        {
          consume_until_eos ();