[PATCH] Sema: Diagnose improper application of inheritance keywords

Richard Smith richard at metafoo.co.uk
Tue Jan 21 16:41:33 PST 2014



================
Comment at: include/clang/AST/DeclCXX.h:1605
@@ -1604,1 +1604,3 @@
   void setMSInheritanceModel();
+  /// \brief Calculate what the inheritance model would be for this class.
+  MSInheritanceAttr::Spelling calculateInheritanceModel() const;
----------------
Maybe clarify that this calculates what the inheritance model for the class should be, based on the definition and ignoring any inheritance attributes.

================
Comment at: test/SemaCXX/member-pointer-ms.cpp:169-170
@@ +168,4 @@
+namespace ErrorTest {
+template <typename T, typename U> struct __single_inheritance A;
+  // expected-warning at -1 {{inheritance model ignored on primary template}}
+template <typename T> struct __multiple_inheritance A<T, T>;
----------------
Maybe add a test that the inheritance model is actually ignored in this case?


http://llvm-reviews.chandlerc.com/D2585



More information about the cfe-commits mailing list