Suppressing the 'direct base ‘{anonymous}::S1’ inaccessible in ‘{anonymous}::D9’
[oota-llvm.git] / unittests / Support / AlignOfTest.cpp
index f01e6609390c18c0099e55eda43620e4128e0190..15935446fb14b26b817775e1db5191645f73e8df 100644 (file)
@@ -22,6 +22,18 @@ namespace {
 #pragma warning(disable:4584)
 #endif
 
+// Suppress direct base ‘{anonymous}::S1’ inaccessible in ‘{anonymous}::D9’ 
+// due to ambiguity warning.
+//
+// Pragma based warning suppression was introduced in GGC 4.2.  Additionally 
+// this warning is "enabled by default".  The warning still appears if -Wall is
+// suppressed.  Apparently GCC suppresses it when -w is specifed, which is odd.
+// At any rate, clang on the other hand gripes about -Wunknown-pragma, so
+// leaving it out of this.
+#if ((__GNUC__ * 100) + __GNUC_MINOR__) >= 402 && !defined(__clang__)
+#pragma GCC diagnostic warning "-w"
+#endif
+
 // Define some fixed alignment types to use in these tests.
 #if __has_feature(cxx_alignas)
 struct alignas(1) A1 { };