[llvm-commits] Is AlignOfTest.cpp intentionally testing ambiguous inheritance?

Joe Abbey joe.abbey at gmail.com
Fri Nov 16 20:30:23 PST 2012


On Nov 16, 2012, at 8:13 PM, Sean Silva <silvas at purdue.edu> wrote:

>> I'm happy to add pragmas to suppress the warnings in this file, we
>> have them for some compilers already. I'd rather nat remove the test
>> just because I don't know how else to get coverage here besides
>> somewhat exhaustive testing of various patterns.
> 
> I think this would be appreciated just to keep the build a little bit
> cleaner. Thanks!
> 
> -- Sean Silva


Suppressing all warnings from GCC in AlignOfTest.cpp

Index: ../unittests/Support/AlignOfTest.cpp
===================================================================
--- ../unittests/Support/AlignOfTest.cpp	(revision 168247)
+++ ../unittests/Support/AlignOfTest.cpp	(working copy)
@@ -22,6 +22,18 @@
 #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 clang 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 { };

Ok to commit?

Joe



More information about the llvm-commits mailing list