llvm-project/clang/lib
Peter Collingbourne b289fe64c1 [ms-cxxabi] Look up operator delete() at every virtual dtor declaration.
While the C++ standard requires that this lookup take place only at the
definition point of a virtual destructor (C++11 [class.dtor]p12), the
Microsoft ABI may require the compiler to emit a deleting destructor
for any virtual destructor declared in the TU, including ones without
a body, requiring an operator delete() lookup for every virtual
destructor declaration.  The result of the lookup should be the same
no matter which declaration is used (except in weird corner cases).

This change will cause us to reject some valid TUs in Microsoft ABI
mode, e.g.:

struct A {
  void operator delete(void *);
};

struct B {
  void operator delete(void *);
};

struct C : A, B {
  virtual ~C();
};

As Richard points out, every virtual function declared in a TU
(including this virtual destructor) is odr-used, so it must be defined
in any program which declares it, or the program is ill formed, no
diagnostic required.  Because we know that any definition of this
destructor will cause the lookup to fail, the compiler can choose to
issue a diagnostic here.

Differential Revision: http://llvm-reviews.chandlerc.com/D822

llvm-svn: 182270
2013-05-20 14:12:25 +00:00
..
ARCMigrate Cleanup handling of UniqueExternalLinkage. 2013-05-13 00:12:11 +00:00
AST Removed invalid character. 2013-05-18 04:32:15 +00:00
ASTMatchers Move documentation to the constructor. Fixes a -Wdocumentation warning 2013-05-17 17:50:16 +00:00
Analysis Revert "[analyzer; alternate edges] improve support for edges with PseudoObjectExprs." 2013-05-18 02:26:50 +00:00
Basic OpenBSD/sparc64 uses long long for int64_t and intmax_t. 2013-05-19 17:53:37 +00:00
CodeGen Implement __declspec(selectany) under -fms-extensions 2013-05-20 14:02:37 +00:00
Driver Extend default blacklist logic to MSan and TSan. 2013-05-20 14:10:58 +00:00
Edit [objcmt] Fix a mishandled conversion to objc directory literal. 2013-04-06 01:13:17 +00:00
Format Clang-format: allow -style="{yaml/json}" on command line 2013-05-19 00:53:30 +00:00
Frontend C++1y deduced return types: when we deduce a return type for a function which 2013-05-11 05:45:24 +00:00
FrontendTool <rdar://problem/13509689> Introduce -module-file-info option that provides information about a particular module file. 2013-03-27 16:47:18 +00:00
Headers Add arm_neon.h to the builtin intrinsics module map. 2013-05-20 14:07:18 +00:00
Lex Add -Wincomplete-module, which detects when a header is included from a module but isn't itself part of a module. 2013-05-20 13:49:41 +00:00
Parse Objective-C parsing. Error recovery when category implementation 2013-05-17 17:58:11 +00:00
Rewrite Use only explicit bool conversion operator 2013-05-15 07:37:26 +00:00
Sema [ms-cxxabi] Look up operator delete() at every virtual dtor declaration. 2013-05-20 14:12:25 +00:00
Serialization First pass of semantic analysis for init-captures: check the initializer, build 2013-05-16 06:20:58 +00:00
StaticAnalyzer [analyzer] New edges: include an edge to the end-of-path location. 2013-05-18 02:27:13 +00:00
Tooling Add a more convenient interface to use clang-format. 2013-05-16 10:40:07 +00:00
CMakeLists.txt Initial version of formatting library. 2012-12-03 18:12:45 +00:00
Makefile Dont use/link ARCMT, StaticAnalyzer and Rewriter to clang when the user 2012-12-13 16:09:42 +00:00