#undef inline // { dg-warning "undefining keyword 'inline'" }
#define inline __inline__ __attribute__((__always_inline__)) // { dg-warning "keyword 'inline' defined as macro" }
#define likely(a) a
-#undef likely // { dg-warning "undefining keyword 'likely'" "" { target c++20 } }
+#undef likely
#define unlikely(a, b, c) a + b + c
#define unlikely(a, b, c) a + b + c
-#undef unlikely // { dg-warning "undefining keyword 'unlikely'" "" { target c++20 } }
+#undef unlikely
#undef deprecated // { dg-error "undefining keyword 'deprecated'" "" { target c++26 } }
#undef fallthrough // { dg-error "undefining keyword 'fallthrough'" "" { target c++26 } }
#undef indeterminate
-#undef likely // { dg-error "undefining keyword 'likely'" "" { target c++26 } }
+#undef likely
#undef maybe_unused // { dg-error "undefining keyword 'maybe_unused'" "" { target c++26 } }
#undef nodiscard // { dg-error "undefining keyword 'nodiscard'" "" { target c++26 } }
#undef noreturn // { dg-error "undefining keyword 'noreturn'" "" { target c++26 } }
#undef no_unique_address // { dg-error "undefining keyword 'no_unique_address'" "" { target c++26 } }
-#undef unlikely // { dg-error "undefining keyword 'unlikely'" "" { target c++26 } }
+#undef unlikely
#undef deprecated // { dg-warning "undefining keyword 'deprecated'" "" { target c++26 } }
#undef fallthrough // { dg-warning "undefining keyword 'fallthrough'" "" { target c++26 } }
#undef indeterminate
-#undef likely // { dg-warning "undefining keyword 'likely'" "" { target c++26 } }
+#undef likely
#undef maybe_unused // { dg-warning "undefining keyword 'maybe_unused'" "" { target c++26 } }
#undef nodiscard // { dg-warning "undefining keyword 'nodiscard'" "" { target c++26 } }
#undef noreturn // { dg-warning "undefining keyword 'noreturn'" "" { target c++26 } }
#undef no_unique_address // { dg-warning "undefining keyword 'no_unique_address'" "" { target c++26 } }
-#undef unlikely // { dg-warning "undefining keyword 'unlikely'" "" { target c++26 } }
+#undef unlikely
#undef deprecated // { dg-warning "undefining keyword 'deprecated'" "" { target c++14 } }
#undef fallthrough // { dg-warning "undefining keyword 'fallthrough'" "" { target c++17 } }
#undef indeterminate
-#undef likely // { dg-warning "undefining keyword 'likely'" "" { target c++20 } }
+#undef likely
#undef maybe_unused // { dg-warning "undefining keyword 'maybe_unused'" "" { target c++17 } }
#undef nodiscard // { dg-warning "undefining keyword 'nodiscard'" "" { target c++17 } }
#undef noreturn // { dg-warning "undefining keyword 'noreturn'" "" { target c++11 } }
#undef no_unique_address // { dg-warning "undefining keyword 'no_unique_address'" "" { target c++20 } }
-#undef unlikely // { dg-warning "undefining keyword 'unlikely'" "" { target c++20 } }
+#undef unlikely
#undef inline // { dg-error "undefining keyword 'inline'" "" { target c++26 } }
#define inline __inline__ __attribute__((__always_inline__)) // { dg-error "keyword 'inline' defined as macro" "" { target c++26 } }
#define likely(a) a
-#undef likely // { dg-error "undefining keyword 'likely'" "" { target c++26 } }
+#undef likely
#define unlikely(a, b, c) a + b + c
#define unlikely(a, b, c) a + b + c
&& !CPP_OPTION (pfile, suppress_builtin_macro_warnings)
&& cpp_keyword_p (node))
{
- if (CPP_OPTION (pfile, cpp_pedantic)
- && CPP_OPTION (pfile, cplusplus)
- && CPP_OPTION (pfile, lang) >= CLK_GNUCXX26)
+ if (CPP_OPTION (pfile, cplusplus)
+ && (strcmp ((const char *) NODE_NAME (node), "likely") == 0
+ || strcmp ((const char *) NODE_NAME (node),
+ "unlikely") == 0))
+ /* CWG3053: likely and unlikely can be undefined. */;
+ else if (CPP_OPTION (pfile, cpp_pedantic)
+ && CPP_OPTION (pfile, cplusplus)
+ && CPP_OPTION (pfile, lang) >= CLK_GNUCXX26)
cpp_pedwarning (pfile, CPP_W_KEYWORD_MACRO,
"undefining keyword %qs", NODE_NAME (node));
else