diff options
| author | Richard Smith <richard-llvm@metafoo.co.uk> | 2013-03-18 23:37:25 +0000 |
|---|---|---|
| committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2013-03-18 23:37:25 +0000 |
| commit | 9cf21ae068bd89f3473b811e4e5567aea6e26185 (patch) | |
| tree | 00cef493af4edee52c329eff5b4cb904c3388521 /clang/test/SemaCXX/attr-cxx0x.cpp | |
| parent | 2d0edec994ebf22ba0dc9dccac215b1a9948e307 (diff) | |
| download | bcm5719-llvm-9cf21ae068bd89f3473b811e4e5567aea6e26185.tar.gz bcm5719-llvm-9cf21ae068bd89f3473b811e4e5567aea6e26185.zip | |
Diagnose uses of 'alignof' on functions in -pedantic mode.
llvm-svn: 177354
Diffstat (limited to 'clang/test/SemaCXX/attr-cxx0x.cpp')
| -rw-r--r-- | clang/test/SemaCXX/attr-cxx0x.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/clang/test/SemaCXX/attr-cxx0x.cpp b/clang/test/SemaCXX/attr-cxx0x.cpp index 002800e749e..e9276cd2d9e 100644 --- a/clang/test/SemaCXX/attr-cxx0x.cpp +++ b/clang/test/SemaCXX/attr-cxx0x.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -fsyntax-only -fcxx-exceptions -verify -std=c++11 %s +// RUN: %clang_cc1 -fsyntax-only -fcxx-exceptions -verify -pedantic -std=c++11 %s int align_illegal alignas(3); //expected-error {{requested alignment is not a power of 2}} char align_big alignas(int); @@ -43,3 +43,5 @@ static_assert(alignof(align_class_template<16>) == 16, "template's alignment is static_assert(alignof(align_class_temp_pack_type<short, int, long>) == alignof(long), "template's alignment is wrong"); static_assert(alignof(align_class_temp_pack_expr<8, 16, 32>) == 32, "template's alignment is wrong"); static_assert(alignof(outer<int,char>::inner<double,short>) == alignof(int) * alignof(double), "template's alignment is wrong"); + +static_assert(alignof(int(int)) >= 1, "alignof(function) not positive"); // expected-warning{{invalid application of 'alignof' to a function type}} |

