forked from llvm-mirror/clang
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Sema] Implement Core 2094: Trivial copy/move constructor for class w…
…ith volatile member Summary: This patch implements http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#2094 which reverts Core 496. Reviewers: rsmith Reviewed By: rsmith Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D32984 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@302593 91177308-0d34-0410-b5e6-96231b3b80d8
- Loading branch information
Showing
5 changed files
with
38 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
// RUN: %clang_cc1 -std=c++98 -triple x86_64-unknown-unknown %s -verify -fexceptions -fcxx-exceptions -pedantic-errors \ | ||
// RUN: -Wno-variadic-macros -Wno-c11-extensions | ||
// RUN: %clang_cc1 -std=c++11 -triple x86_64-unknown-unknown %s -verify -fexceptions -fcxx-exceptions -pedantic-errors | ||
// RUN: %clang_cc1 -std=c++14 -triple x86_64-unknown-unknown %s -verify -fexceptions -fcxx-exceptions -pedantic-errors | ||
// RUN: %clang_cc1 -std=c++1z -triple x86_64-unknown-unknown %s -verify -fexceptions -fcxx-exceptions -pedantic-errors | ||
|
||
// expected-no-diagnostics | ||
|
||
#if __cplusplus < 201103L | ||
#define static_assert(...) _Static_assert(__VA_ARGS__) | ||
#endif | ||
|
||
namespace dr2094 { // dr2094: 5.0 | ||
struct A { int n; }; | ||
struct B { volatile int n; }; | ||
static_assert(__is_trivially_copyable(volatile int), ""); | ||
static_assert(__is_trivially_copyable(const volatile int), ""); | ||
static_assert(__is_trivially_copyable(const volatile int[]), ""); | ||
static_assert(__is_trivially_copyable(A), ""); | ||
static_assert(__is_trivially_copyable(volatile A), ""); | ||
static_assert(__is_trivially_copyable(const volatile A), ""); | ||
static_assert(__is_trivially_copyable(const volatile A[]), ""); | ||
static_assert(__is_trivially_copyable(B), ""); | ||
|
||
static_assert(__is_trivially_constructible(A, A const&), ""); | ||
static_assert(__is_trivially_constructible(B, B const&), ""); | ||
|
||
static_assert(__is_trivially_assignable(A, const A&), ""); | ||
static_assert(__is_trivially_assignable(B, const B&), ""); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters