Skip to content

Commit 7b70c2e

Browse files
committed
[pseudo] Fix initializer of string table
Apparently new string[/*no size*/]{"foo", "bar"} is a clang/gcc extension?
1 parent fefa36a commit 7b70c2e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

clang-tools-extra/pseudo/gen/Main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ namespace {
7070
// keyword: `INT` becomes `INT`;
7171
// terminal: `IDENTIFIER` becomes `IDENTIFIER`;
7272
std::string mangleSymbol(SymbolID SID, const Grammar &G) {
73-
static std::string *TokNames = new std::string[]{
73+
static auto &TokNames = *new std::vector<std::string>{
7474
#define TOK(X) llvm::StringRef(#X).upper(),
7575
#define KEYWORD(Keyword, Condition) llvm::StringRef(#Keyword).upper(),
7676
#include "clang/Basic/TokenKinds.def"

0 commit comments

Comments
 (0)