diff options
author | Marek Polacek <polacek@redhat.com> | 2016-09-26 15:53:28 +0000 |
---|---|---|
committer | Marek Polacek <mpolacek@gcc.gnu.org> | 2016-09-26 15:53:28 +0000 |
commit | c6147dc433015793d92602811e585b83c9018bc2 (patch) | |
tree | 0ae29fdb0d04e4498b59ab6240031213610fb6e8 /gcc/c-family | |
parent | 8e4284d0b24bd3c745c054054d673ed306d30467 (diff) | |
download | gcc-c6147dc433015793d92602811e585b83c9018bc2.zip gcc-c6147dc433015793d92602811e585b83c9018bc2.tar.gz gcc-c6147dc433015793d92602811e585b83c9018bc2.tar.bz2 |
c-lex.c (c_common_has_attribute): Handle attribute fallthrough.
* c-lex.c (c_common_has_attribute): Handle attribute fallthrough.
* system.h: Use __has_attribute to check whether the fallthrough
attribute is supported.
* g++.dg/cpp1z/feat-cxx1z.C: Test attribute fallthrough.
From-SVN: r240499
Diffstat (limited to 'gcc/c-family')
-rw-r--r-- | gcc/c-family/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/c-family/c-lex.c | 3 |
2 files changed, 6 insertions, 1 deletions
diff --git a/gcc/c-family/ChangeLog b/gcc/c-family/ChangeLog index cd3eeab..6eec895 100644 --- a/gcc/c-family/ChangeLog +++ b/gcc/c-family/ChangeLog @@ -1,5 +1,9 @@ 2016-09-26 Marek Polacek <polacek@redhat.com> + * c-lex.c (c_common_has_attribute): Handle attribute fallthrough. + +2016-09-26 Marek Polacek <polacek@redhat.com> + PR c/7652 * c-common.c (c_common_attribute_table): Add fallthrough attribute. (handle_fallthrough_attribute): New function. diff --git a/gcc/c-family/c-lex.c b/gcc/c-family/c-lex.c index 829c18b..5c6496e 100644 --- a/gcc/c-family/c-lex.c +++ b/gcc/c-family/c-lex.c @@ -350,7 +350,8 @@ c_common_has_attribute (cpp_reader *pfile) else if (is_attribute_p ("deprecated", attr_name)) result = 201309; else if (is_attribute_p ("maybe_unused", attr_name) - || is_attribute_p ("nodiscard", attr_name)) + || is_attribute_p ("nodiscard", attr_name) + || is_attribute_p ("fallthrough", attr_name)) result = 201603; if (result) attr_name = NULL_TREE; |