diff options
author | dim <dim@FreeBSD.org> | 2013-06-10 20:45:12 +0000 |
---|---|---|
committer | dim <dim@FreeBSD.org> | 2013-06-10 20:45:12 +0000 |
commit | ea266cad53e3d49771fa38103913d3ec7a166694 (patch) | |
tree | 8f7776b7310bebaf415ac5b69e46e9f928c37144 /test/SemaTemplate/attributes.cpp | |
parent | c72c57c9e9b69944e3e009cd5e209634839581d3 (diff) | |
download | FreeBSD-src-ea266cad53e3d49771fa38103913d3ec7a166694.zip FreeBSD-src-ea266cad53e3d49771fa38103913d3ec7a166694.tar.gz |
Vendor import of clang tags/RELEASE_33/final r183502 (effectively, 3.3
release):
http://llvm.org/svn/llvm-project/cfe/tags/RELEASE_33/final@183502
Diffstat (limited to 'test/SemaTemplate/attributes.cpp')
-rw-r--r-- | test/SemaTemplate/attributes.cpp | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/test/SemaTemplate/attributes.cpp b/test/SemaTemplate/attributes.cpp index 495f4a7..5a06a70 100644 --- a/test/SemaTemplate/attributes.cpp +++ b/test/SemaTemplate/attributes.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -fsyntax-only -verify %s +// RUN: %clang_cc1 -std=gnu++11 -fsyntax-only -verify %s namespace attribute_aligned { template<int N> @@ -18,6 +18,26 @@ namespace attribute_aligned { check_alignment<2>::t c2; check_alignment<3>::t c3; // expected-note 2 {{in instantiation}} check_alignment<4>::t c4; + + template<unsigned Size, unsigned Align> + class my_aligned_storage + { + __attribute__((align(Align))) char storage[Size]; + }; + + template<typename T> + class C { + public: + C() { + static_assert(sizeof(t) == sizeof(T), "my_aligned_storage size wrong"); + static_assert(alignof(t) == alignof(T), "my_aligned_storage align wrong"); // expected-warning{{'alignof' applied to an expression is a GNU extension}} + } + + private: + my_aligned_storage<sizeof(T), alignof(T)> t; + }; + + C<double> cd; } namespace PR9049 { |