This is an archive of the discontinued LLVM Phabricator instance.

MS ABI: Diagnose unspecified inheritance model ptrs in the best case
Needs ReviewPublic

Authored by majnemer on Jul 24 2014, 12:39 AM.

Details

Reviewers
rnk
rsmith
Summary

If the compiler is choosing pointer members using a best-case scheme,
diagnose when we select the unspecified representation. It is unlikely
that this is what the user intended.

Diff Detail

Event Timeline

majnemer updated this revision to Diff 11834.Jul 24 2014, 12:39 AM
majnemer retitled this revision from to MS ABI: Diagnose unspecified inheritance model ptrs in the best case.
majnemer updated this object.
majnemer added reviewers: rnk, rsmith.
majnemer added a subscriber: Unknown Object (MLST).
rsmith added inline comments.Jul 24 2014, 3:09 PM
include/clang/Basic/DiagnosticSemaKinds.td
2514–2515

Maybe this should also mention that (a) this happened because the class type was incomplete at the point where the inheritance model was first required, and (b) a different inheritance model might be picked in a different TU?

majnemer updated this revision to Diff 11912.Jul 26 2014, 12:27 AM
  • Address review comments.
rsmith added inline comments.Sep 26 2014, 7:29 PM
lib/Sema/SemaType.cpp
5177–5179

I think I'd prefer to switch over these diagnostics, so the primary diagnostic says "I needed the inheritance model here, but the class was incomplete, so I picked one", and the note says "here's the forward declaration; you can add an explicit inheritance model here to suppress the diagnostic" along with a fixit.