From: David Malcolm Date: Wed, 16 Oct 2013 15:25:23 +0000 (+0000) Subject: gengtype: Ignore access-control keywords when parsing fields X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=c22df64f91c2f4fcd22eb94ed55af08095e3ad78;p=gcc.git gengtype: Ignore access-control keywords when parsing fields * gengtype-parse.c (struct_field_seq): Ignore access-control keywords ("public:" etc). From-SVN: r203708 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 6fad912561c..c1617d4ba24 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2013-10-16 David Malcolm + + * gengtype-parse.c (struct_field_seq): Ignore access-control + keywords ("public:" etc). + 2013-10-16 Marcus Shawcroft * config/aarch64/aarch64.c (aarch64_regno_regclass): Classify diff --git a/gcc/gengtype-parse.c b/gcc/gengtype-parse.c index 68d372eb684..e5204c1a71d 100644 --- a/gcc/gengtype-parse.c +++ b/gcc/gengtype-parse.c @@ -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 ();