| 1 | // RUN: %clang_cc1 -std=c++98 -triple x86_64-unknown-unknown %s -verify -fexceptions -fcxx-exceptions -pedantic-errors \ |
| 2 | // RUN: -Wno-variadic-macros -Wno-c11-extensions |
| 3 | // RUN: %clang_cc1 -std=c++11 -triple x86_64-unknown-unknown %s -verify -fexceptions -fcxx-exceptions -pedantic-errors |
| 4 | // RUN: %clang_cc1 -std=c++14 -triple x86_64-unknown-unknown %s -verify -fexceptions -fcxx-exceptions -pedantic-errors |
| 5 | // RUN: %clang_cc1 -std=c++1z -triple x86_64-unknown-unknown %s -verify -fexceptions -fcxx-exceptions -pedantic-errors |
| 6 | |
| 7 | // expected-no-diagnostics |
| 8 | |
| 9 | #if __cplusplus < 201103L |
| 10 | #define static_assert(...) _Static_assert(__VA_ARGS__) |
| 11 | #endif |
| 12 | |
| 13 | namespace dr2094 { // dr2094: 5 |
| 14 | struct A { int n; }; |
| 15 | struct B { volatile int n; }; |
| 16 | static_assert(__is_trivially_copyable(volatile int), ""); |
| 17 | static_assert(__is_trivially_copyable(const volatile int), ""); |
| 18 | static_assert(__is_trivially_copyable(const volatile int[]), ""); |
| 19 | static_assert(__is_trivially_copyable(A), ""); |
| 20 | static_assert(__is_trivially_copyable(volatile A), ""); |
| 21 | static_assert(__is_trivially_copyable(const volatile A), ""); |
| 22 | static_assert(__is_trivially_copyable(const volatile A[]), ""); |
| 23 | static_assert(__is_trivially_copyable(B), ""); |
| 24 | |
| 25 | static_assert(__is_trivially_constructible(A, A const&), ""); |
| 26 | static_assert(__is_trivially_constructible(B, B const&), ""); |
| 27 | |
| 28 | static_assert(__is_trivially_assignable(A, const A&), ""); |
| 29 | static_assert(__is_trivially_assignable(B, const B&), ""); |
| 30 | } |
| 31 | |