r283303 - [analyzer] Squash a compile error in r283301.

Artem Dergachev via cfe-commits cfe-commits at lists.llvm.org
Wed Oct 5 01:47:32 PDT 2016


Author: dergachev
Date: Wed Oct  5 03:47:31 2016
New Revision: 283303

URL: http://llvm.org/viewvc/llvm-project?rev=283303&view=rev
Log:
[analyzer] Squash a compile error in r283301.

The constexpr string literal trick isn't supported in MSVC2013.

Modified:
    cfe/trunk/include/clang/StaticAnalyzer/Core/BugReporter/BugReporterVisitor.h
    cfe/trunk/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp

Modified: cfe/trunk/include/clang/StaticAnalyzer/Core/BugReporter/BugReporterVisitor.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/StaticAnalyzer/Core/BugReporter/BugReporterVisitor.h?rev=283303&r1=283302&r2=283303&view=diff
==============================================================================
--- cfe/trunk/include/clang/StaticAnalyzer/Core/BugReporter/BugReporterVisitor.h (original)
+++ cfe/trunk/include/clang/StaticAnalyzer/Core/BugReporter/BugReporterVisitor.h Wed Oct  5 03:47:31 2016
@@ -186,10 +186,9 @@ public:
 class ConditionBRVisitor final
     : public BugReporterVisitorImpl<ConditionBRVisitor> {
 
-  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 {

Modified: cfe/trunk/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp?rev=283303&r1=283302&r2=283303&view=diff
==============================================================================
--- cfe/trunk/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp (original)
+++ cfe/trunk/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp Wed Oct  5 03:47:31 2016
@@ -1603,6 +1603,11 @@ ConditionBRVisitor::VisitTrueTest(const
   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 ||




More information about the cfe-commits mailing list