[llvm] r289858 - Re-add the check for __has_attribute in StringLiteral.
Zachary Turner via llvm-commits
llvm-commits at lists.llvm.org
Thu Dec 15 11:33:32 PST 2016
Author: zturner
Date: Thu Dec 15 13:33:31 2016
New Revision: 289858
URL: http://llvm.org/viewvc/llvm-project?rev=289858&view=rev
Log:
Re-add the check for __has_attribute 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=289858&r1=289857&r2=289858&view=diff
==============================================================================
--- llvm/trunk/include/llvm/ADT/StringRef.h (original)
+++ llvm/trunk/include/llvm/ADT/StringRef.h Thu Dec 15 13:33:31 2016
@@ -847,7 +847,7 @@ namespace llvm {
public:
template <size_t N>
constexpr StringLiteral(const char (&Str)[N])
-#if defined(__clang__)
+#if defined(__clang__) && __has_attribute(enable_if)
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wgcc-compat"
__attribute((enable_if(__builtin_strlen(Str) == N - 1,
More information about the llvm-commits
mailing list