diff options
author | dim <dim@FreeBSD.org> | 2015-05-27 18:47:56 +0000 |
---|---|---|
committer | dim <dim@FreeBSD.org> | 2015-05-27 18:47:56 +0000 |
commit | 3191b2b32a96e1a6ee833fcca73e5c8e0c67ba65 (patch) | |
tree | dbbd4047878da71c1a706e26ce05b4e7791b14cc /test/SemaCXX/alignof.cpp | |
parent | 38d6f2e7f2ce51a5b3836d26596c6c34a3288752 (diff) | |
download | FreeBSD-src-3191b2b32a96e1a6ee833fcca73e5c8e0c67ba65.zip FreeBSD-src-3191b2b32a96e1a6ee833fcca73e5c8e0c67ba65.tar.gz |
Vendor import of clang trunk r238337:
https://llvm.org/svn/llvm-project/cfe/trunk@238337
Diffstat (limited to 'test/SemaCXX/alignof.cpp')
-rw-r--r-- | test/SemaCXX/alignof.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/test/SemaCXX/alignof.cpp b/test/SemaCXX/alignof.cpp index 011f459..e3690ea 100644 --- a/test/SemaCXX/alignof.cpp +++ b/test/SemaCXX/alignof.cpp @@ -77,3 +77,23 @@ namespace alignof_array_expr { // ok, does not complete type of S<-1>::a static_assert(alignof(S<-1>::a) == alignof(int), ""); // expected-warning {{GNU extension}} } + +template <typename T> void n(T) { + alignas(T) int T1; + char k[__alignof__(T1)]; + static_assert(sizeof(k) == alignof(long long), ""); +} +template void n(long long); + +namespace PR22042 { +template <typename T> +void Fun(T A) { + typedef int __attribute__((__aligned__(A))) T1; // expected-error {{requested alignment is dependent but declaration is not dependent}} + int k1[__alignof__(T1)]; +} + +template <int N> +struct S { + typedef __attribute__((aligned(N))) int Field[sizeof(N)]; // expected-error {{requested alignment is dependent but declaration is not dependent}} +}; +} |