================
@@ -11,6 +11,88 @@
// cxx98-error@-1 {{variadic macros are a C99 feature}}
#endif
+namespace std { class type_info; }
+namespace cwg2006 { // cwg2006: 2.7
+ void test_object_pointer(const void *cp, volatile void *vp, const volatile
void *cvp) {
+ (void)static_cast<const void*>(cp);
+ (void)static_cast<volatile void*>(vp);
+ (void)static_cast<const volatile void*>(cvp);
+
+ int x = 0;
+ const int cx = 0;
+ const void *p1 = &x;
+ const void *p2 = &cx;
+ (void)p1;
+ (void)p2;
+ }
+
+ void test_cast(int x) {
+ (const void)x;
+ (volatile void)x;
+ (const volatile void)x;
+ }
+
+ const void get_const_void()
+#if __cplusplus >= 201103L
+ noexcept
+#endif
+ {}
+
+ volatile void get_volatile_void()
+#if __cplusplus >= 201103L
+ noexcept
+#endif
+ {}
+ // since-cxx20-warning@-5 {{volatile-qualified return type 'volatile void'
is deprecated}}
+
+ const volatile void get_cv_void()
+#if __cplusplus >= 201103L
+ noexcept
+#endif
+ {}
+ // since-cxx20-warning@-5 {{volatile-qualified return type 'const volatile
void' is deprecated}}
+
+ void test_return() {
+ return get_const_void();
+ }
+
+ void test_return_volatile() {
+ return get_volatile_void();
+ }
+
+ void test_return_cv() {
+ return get_cv_void();
+ }
+
+ void test_conditional(bool b) {
+ b ? get_const_void() : get_const_void();
+ b ? get_volatile_void() : get_const_void();
+ b ? get_cv_void() : get_const_void();
+ }
+
+ void test_typeid() {
+ (void)typeid(const void);
+ (void)typeid(volatile void);
+ (void)typeid(const volatile void);
+ }
+
+#if __cplusplus >= 201103L
+ template <typename T, typename U>
+ struct is_same { static constexpr bool value = false; };
----------------
TPPPP72 wrote:
oh, thanks.
https://github.com/llvm/llvm-project/pull/215259
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits