[PATCH] D87185: Do not construct string from nullptr

Yuriy Chernyshov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Sep 5 03:13:06 PDT 2020


georgthegreat created this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.
georgthegreat requested review of this revision.

While I am trying to forbade this behavior systematically in https://reviews.llvm.org/D79427 / P2166R0 to C++ standard, this PR fixes this (definitelly incorrect) usage in llvm


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D87185

Files:
  llvm/utils/TableGen/DFAEmitter.cpp


Index: llvm/utils/TableGen/DFAEmitter.cpp
===================================================================
--- llvm/utils/TableGen/DFAEmitter.cpp
+++ llvm/utils/TableGen/DFAEmitter.cpp
@@ -174,7 +174,7 @@
 struct Action {
   Record *R = nullptr;
   unsigned I = 0;
-  std::string S = nullptr;
+  std::string S;

   Action() = default;
   Action(Record *R, unsigned I, std::string S) : R(R), I(I), S(S) {}


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D87185.290077.patch
Type: text/x-patch
Size: 408 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200905/76d10355/attachment.bin>


More information about the llvm-commits mailing list