[llvm] r289856 - Ignore -Wgcc-compat diagnostic in StringLiteral.
Zachary Turner via llvm-commits
llvm-commits at lists.llvm.org
Thu Dec 15 11:22:59 PST 2016
Author: zturner
Date: Thu Dec 15 13:22:58 2016
New Revision: 289856
URL: http://llvm.org/viewvc/llvm-project?rev=289856&view=rev
Log:
Ignore -Wgcc-compat diagnostic in StringLiteral.
Modified:
llvm/trunk/include/llvm/ADT/StringRef.h
Modified: llvm/trunk/include/llvm/ADT/StringRef.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/StringRef.h?rev=289856&r1=289855&r2=289856&view=diff
==============================================================================
--- llvm/trunk/include/llvm/ADT/StringRef.h (original)
+++ llvm/trunk/include/llvm/ADT/StringRef.h Thu Dec 15 13:22:58 2016
@@ -847,9 +847,12 @@ namespace llvm {
public:
template <size_t N>
constexpr StringLiteral(const char (&Str)[N])
-#if __has_attribute(enable_if)
+#if defined(__clang__)
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wgcc-compat"
__attribute((enable_if(__builtin_strlen(Str) == N - 1,
"invalid string literal")))
+#pragma clang diagnostic pop
#endif
: StringRef(Str, N - 1) {
}
More information about the llvm-commits
mailing list