llvm-project/clang/lib
David Majnemer d96b99740d MS ABI: Don't force bases to have an inheritance model
Previously, assigning an inheritance model to a derived class would
trigger further assiginments to the various bases of the class.  This
was done to fix a bug where we couldn't handle an implicit
base-to-derived conversion for pointers-to-members when the conversion
was ambiguous at an earlier point.

However, this is not how the MS scheme works.  Instead, assign
inheritance models to *just* the class which owns to declaration we
ended up referencing.

N.B.  This result is surprising in many ways.  It means that it is
possible for a base to have a "larger" inheritance model than it's
derived classes.  It also means that bases in the conversion path do not
get assigned a model.

struct A { void f(); void f(int); };
struct B : A {};
struct C : B {};
void f() { void (C::*x)() = &A::f; }

We can only begin to assign an inheritance model *after* we've seen the
address-of but *before* we've done the implicit conversion the more
derived pointer-to-member type.  After that point, both 'A' and 'C' will
have an inheritance model but 'B' will not.  Surprising, right?

llvm-svn: 215174
2014-08-08 00:10:39 +00:00
..
ARCMigrate Revert "unique_ptr-ify ownership of ASTConsumers" 2014-07-17 22:34:12 +00:00
AST Objective-C ARC. Adding declarations for Objective-C's 2014-08-06 20:56:21 +00:00
ASTMatchers Prevent assert in ASTMatchFinder. 2014-07-23 13:17:47 +00:00
Analysis Mark successors as reachable/unreachable instead of changing the CFG. 2014-08-07 18:44:19 +00:00
Basic Use -Rblah, not -Wblah, to control remark diagnostics. This was always the 2014-08-07 00:24:21 +00:00
CodeGen MS ABI: Handle member function pointers returning a member data pointer 2014-08-07 22:56:13 +00:00
Driver Driver: Add -fno-profile-arcs to go with -fprofile-arcs 2014-08-07 03:14:34 +00:00
Edit [CMake] Reorder libdeps by alphabetical order. 2014-07-14 04:59:27 +00:00
Format FormatTokenLexer: Avoid non-static member initializer. 2014-08-06 16:53:13 +00:00
Frontend Flip the order the preprocessor and frontendaction are informed of the end of a file. 2014-08-07 20:51:16 +00:00
FrontendTool Make clang's rewrite engine a core feature 2014-07-16 16:48:33 +00:00
Headers [AVX512] Add intrinsic for valignd/q 2014-08-05 17:28:23 +00:00
Index Make clang's rewrite engine a core feature 2014-07-16 16:48:33 +00:00
Lex Use -Rblah, not -Wblah, to control remark diagnostics. This was always the 2014-08-07 00:24:21 +00:00
Parse A static_assert declaration cannot be a template; adding the diagnostic for this instead of silently accepting and producing possibly-unexpected behavior. 2014-08-04 20:28:35 +00:00
Rewrite Make clang's rewrite engine a core feature 2014-07-16 16:48:33 +00:00
Sema MS ABI: Don't force bases to have an inheritance model 2014-08-08 00:10:39 +00:00
Serialization [modules] Don't defer performing updates if we have incomplete redecl chains. 2014-08-07 20:58:41 +00:00
StaticAnalyzer Re-applying r214962. 2014-08-07 10:42:17 +00:00
Tooling Make clang's rewrite engine a core feature 2014-07-16 16:48:33 +00:00
CMakeLists.txt Fix build with various feature flag combinations 2014-07-14 22:17:22 +00:00
Makefile Make clang's rewrite engine a core feature 2014-07-16 16:48:33 +00:00