llvm-capstone/clang/test/SemaCXX/ms-empty_bases.cpp
David Majnemer 7eca8a3d41 Address post-commit review feedback to r270457
Add two tests which show our error handling behavior for invalid
parameters in the layout_version and empty_bases attributes.

Amend our documentation to make it more clear that
__declspec(empty_bases) and __declspec(layout_version) can only apply to
classes, structs, and unions.

llvm-svn: 270461
2016-05-23 17:32:35 +00:00

10 lines
704 B
C++

// RUN: %clang_cc1 -triple i386-pc-win32 %s -fsyntax-only -verify -fms-extensions -Wno-microsoft -std=c++11
struct __declspec(empty_bases) S {};
enum __declspec(empty_bases) E {}; // expected-warning{{'empty_bases' attribute only applies to classes}}
int __declspec(empty_bases) I; // expected-warning{{'empty_bases' attribute only applies to classes}}
typedef struct T __declspec(empty_bases) U; // expected-warning{{'empty_bases' attribute only applies to classes}}
auto z = []() __declspec(empty_bases) { return nullptr; }; // expected-warning{{'empty_bases' attribute only applies to classes}}
struct __declspec(empty_bases(1)) X {}; // expected-error{{'empty_bases' attribute takes no arguments}}