llvm-for-llvmta/tools/clang/test/CXX/dcl.dcl/dcl.attr/dcl.align/p8.cpp

7 lines
405 B
C++
Raw Normal View History

2022-04-25 13:02:35 +02:00
// RUN: %clang_cc1 -std=c++11 -verify %s -triple x86_64-linux-gnu
alignas(double) void f(); // expected-error {{'alignas' attribute only applies to variables, data members and tag types}}
alignas(double) unsigned char c[sizeof(double)]; // expected-note {{previous}}
extern unsigned char c[sizeof(double)];
alignas(float) extern unsigned char c[sizeof(double)]; // expected-error {{different alignment}}