*
* This is the C++ version of the Standard C Library header @c iso646.h,
* which is empty in C++.
+ *
+ * @since C++11 (removed in C++20)
*/
#ifndef _GLIBCXX_CISO646
#define _GLIBCXX_CISO646
#include <bits/c++config.h>
-#if __cplusplus >= 202002L && ! _GLIBCXX_USE_DEPRECATED
-# error "<ciso646> is not a standard header in C++20, use <version> to detect implementation-specific macros"
-#elif __cplusplus >= 201703L && defined __DEPRECATED
-# pragma GCC diagnostic push
-# pragma GCC diagnostic ignored "-Wc++23-extensions"
-# warning "<ciso646> is deprecated in C++17, use <version> to detect implementation-specific macros"
-# pragma GCC diagnostic pop
+#if __cplusplus >= 202002L
+# if ! _GLIBCXX_USE_DEPRECATED
+# error "<ciso646> is not a standard header since C++20, use <version> to detect implementation-specific macros"
+# elif defined __DEPRECATED
+# pragma GCC diagnostic push
+# pragma GCC diagnostic ignored "-Wc++23-extensions"
+# warning "<ciso646> is not a standard header since C++20, use <version> to detect implementation-specific macros"
+# pragma GCC diagnostic pop
+# endif
#endif
#endif
--- /dev/null
+// { dg-options " -Wdeprecated -fno-operator-names" }
+// { dg-do preprocess }
+
+// Should get a warning for C++20 and up without -D_GLIBCXX_USE_DEPRECATED=0
+// { dg-warning "not a standard header" "" { target c++20 } 0 }
+
+#include "macros.cc"