]> granicus.if.org Git - clang/commit
Ignore the "novtable" declspec when not using the Microsoft C++ ABI.
authorBob Wilson <bob.wilson@apple.com>
Mon, 20 Jul 2015 22:57:31 +0000 (22:57 +0000)
committerBob Wilson <bob.wilson@apple.com>
Mon, 20 Jul 2015 22:57:31 +0000 (22:57 +0000)
commit4e5f9fb46e1bfcb4ec1831785225496c5e11f413
tree4b1e5226bfa01f4195c84afb1463cb3433e26a97
parentf3e8e6409f7fdf07b2d058dcb797b019ec2595a2
Ignore the "novtable" declspec when not using the Microsoft C++ ABI.

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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@242730 91177308-0d34-0410-b5e6-96231b3b80d8
13 files changed:
include/clang/Basic/Attr.td
include/clang/Basic/Attributes.h
include/clang/Sema/AttributeList.h
lib/Basic/Attributes.cpp
lib/Lex/PPMacroExpansion.cpp
lib/Parse/ParseDecl.cpp
lib/Parse/ParseDeclCXX.cpp
lib/Sema/AttributeList.cpp
lib/Sema/SemaDeclAttr.cpp
test/Parser/MicrosoftExtensions.cpp
test/SemaCXX/ms-novtable.cpp
test/SemaCXX/ms-unsupported.cpp [new file with mode: 0644]
utils/TableGen/ClangAttrEmitter.cpp