mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-17 04:06:46 +00:00

Clang used to silently ignore __declspec(novtable). It is implemented now, but leaving the vtable uninitialized does not work when using the Itanium ABI, where the class layout for complex class hierarchies is stored in the vtable. It might be possible to honor the novtable attribute in some simple cases and either report an error or ignore it in more complex situations, but it’s not clear if that would be worthwhile. There is also value in having a simple and predictable behavior, so this changes clang to simply ignore novtable when not using the Microsoft C++ ABI. llvm-svn: 242730
6 lines
352 B
C++
6 lines
352 B
C++
// RUN: %clang_cc1 -triple x86_64-pc-windows-gnu %s -fsyntax-only -verify -fms-extensions -Wno-microsoft -std=c++11
|
|
|
|
// "novtable" is ignored except with the Microsoft C++ ABI.
|
|
// MinGW uses the Itanium C++ ABI so check that it is ignored there.
|
|
struct __declspec(novtable) S {}; // expected-warning{{__declspec attribute 'novtable' is not supported}}
|