Clang Project

clang_source_code/test/SemaCXX/ms-novtable.cpp
1// RUN: %clang_cc1 -triple i386-pc-win32 %s -fsyntax-only -verify -fms-extensions -Wno-microsoft -std=c++11
2
3struct __declspec(novtable) S {};
4enum __declspec(novtable) E {}; // expected-warning{{'novtable' attribute only applies to classes}}
5int __declspec(novtable) I; // expected-warning{{'novtable' attribute only applies to classes}}
6typedef struct T __declspec(novtable) U; // expected-warning{{'novtable' attribute only applies to classes}}
7auto z = []() __declspec(novtable) { return nullptr; }; // expected-warning{{'novtable' attribute only applies to classes}}
8