diff options
-rw-r--r-- | gcc/c-family/c-lex.cc | 18 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/c2x-has-c-attribute-2.c | 26 |
2 files changed, 20 insertions, 24 deletions
diff --git a/gcc/c-family/c-lex.cc b/gcc/c-family/c-lex.cc index 6eb0fae..dcd061c 100644 --- a/gcc/c-family/c-lex.cc +++ b/gcc/c-family/c-lex.cc @@ -392,17 +392,13 @@ c_common_has_attribute (cpp_reader *pfile, bool std_syntax) } else { - if (is_attribute_p ("deprecated", attr_name)) - result = 201904; - else if (is_attribute_p ("fallthrough", attr_name)) - result = 201910; - else if (is_attribute_p ("nodiscard", attr_name)) - result = 202003; - else if (is_attribute_p ("maybe_unused", attr_name)) - result = 202106; - else if (is_attribute_p ("noreturn", attr_name) - || is_attribute_p ("_Noreturn", attr_name)) - result = 202202; + if (is_attribute_p ("deprecated", attr_name) + || is_attribute_p ("fallthrough", attr_name) + || is_attribute_p ("maybe_unused", attr_name) + || is_attribute_p ("nodiscard", attr_name) + || is_attribute_p ("noreturn", attr_name) + || is_attribute_p ("_Noreturn", attr_name)) + result = 202311; } if (result) attr_name = NULL_TREE; diff --git a/gcc/testsuite/gcc.dg/c2x-has-c-attribute-2.c b/gcc/testsuite/gcc.dg/c2x-has-c-attribute-2.c index 3c34ab6..dc92b95 100644 --- a/gcc/testsuite/gcc.dg/c2x-has-c-attribute-2.c +++ b/gcc/testsuite/gcc.dg/c2x-has-c-attribute-2.c @@ -2,56 +2,56 @@ /* { dg-do preprocess } */ /* { dg-options "-std=c2x -pedantic-errors" } */ -#if __has_c_attribute ( nodiscard ) != 202003L +#if __has_c_attribute ( nodiscard ) != 202311L #error "bad result for nodiscard" #endif -#if __has_c_attribute ( __nodiscard__ ) != 202003L +#if __has_c_attribute ( __nodiscard__ ) != 202311L #error "bad result for __nodiscard__" #endif -#if __has_c_attribute(maybe_unused) != 202106L +#if __has_c_attribute(maybe_unused) != 202311L #error "bad result for maybe_unused" #endif -#if __has_c_attribute(__maybe_unused__) != 202106L +#if __has_c_attribute(__maybe_unused__) != 202311L #error "bad result for __maybe_unused__" #endif -#if __has_c_attribute (deprecated) != 201904L +#if __has_c_attribute (deprecated) != 202311L #error "bad result for deprecated" #endif -#if __has_c_attribute (__deprecated__) != 201904L +#if __has_c_attribute (__deprecated__) != 202311L #error "bad result for __deprecated__" #endif -#if __has_c_attribute (fallthrough) != 201910L +#if __has_c_attribute (fallthrough) != 202311L #error "bad result for fallthrough" #endif -#if __has_c_attribute (__fallthrough__) != 201910L +#if __has_c_attribute (__fallthrough__) != 202311L #error "bad result for __fallthrough__" #endif -#if __has_c_attribute (noreturn) != 202202L +#if __has_c_attribute (noreturn) != 202311L #error "bad result for noreturn" #endif -#if __has_c_attribute (__noreturn__) != 202202L +#if __has_c_attribute (__noreturn__) != 202311L #error "bad result for __noreturn__" #endif -#if __has_c_attribute (_Noreturn) != 202202L +#if __has_c_attribute (_Noreturn) != 202311L #error "bad result for _Noreturn" #endif -#if __has_c_attribute (___Noreturn__) != 202202L +#if __has_c_attribute (___Noreturn__) != 202311L #error "bad result for ___Noreturn__" #endif /* Macros in the attribute name are expanded. */ #define foo deprecated -#if __has_c_attribute (foo) != 201904L +#if __has_c_attribute (foo) != 202311L #error "bad result for foo" #endif |