From f002f9ac813f04874a514814f94890e32a9ed57f Mon Sep 17 00:00:00 2001 From: Artem Dergachev Date: Wed, 5 Oct 2016 08:47:31 +0000 Subject: [PATCH] [analyzer] Squash a compile error in r283301. The constexpr string literal trick isn't supported in MSVC2013. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@283303 91177308-0d34-0410-b5e6-96231b3b80d8 --- .../StaticAnalyzer/Core/BugReporter/BugReporterVisitor.h | 7 +++---- lib/StaticAnalyzer/Core/BugReporterVisitors.cpp | 5 +++++ 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/include/clang/StaticAnalyzer/Core/BugReporter/BugReporterVisitor.h b/include/clang/StaticAnalyzer/Core/BugReporter/BugReporterVisitor.h index c2982a7079..fdff74792f 100644 --- a/include/clang/StaticAnalyzer/Core/BugReporter/BugReporterVisitor.h +++ b/include/clang/StaticAnalyzer/Core/BugReporter/BugReporterVisitor.h @@ -186,10 +186,9 @@ public: class ConditionBRVisitor final : public BugReporterVisitorImpl { - static constexpr const char *const GenericTrueMessage = - "Assuming the condition is true"; - static constexpr const char *const GenericFalseMessage = - "Assuming the condition is false"; + // FIXME: constexpr initialization isn't supported by MSVC2013. + static const char *const GenericTrueMessage; + static const char *const GenericFalseMessage; public: void Profile(llvm::FoldingSetNodeID &ID) const override { diff --git a/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp b/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp index 08f636df7f..7045d8bb94 100644 --- a/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp +++ b/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp @@ -1603,6 +1603,11 @@ ConditionBRVisitor::VisitTrueTest(const Expr *Cond, return event; } +const char *const ConditionBRVisitor::GenericTrueMessage = + "Assuming the condition is true"; +const char *const ConditionBRVisitor::GenericFalseMessage = + "Assuming the condition is false"; + bool ConditionBRVisitor::isPieceMessageGeneric( const PathDiagnosticPiece *Piece) { return Piece->getString() == GenericTrueMessage || -- 2.40.0