[PATCH] D42189: [clang-format] Replace unordered_set with an array

Benjamin Kramer via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jan 17 10:54:08 PST 2018

bkramer added inline comments.

Comment at: lib/Format/Format.cpp:1424
                           const AdditionalKeywords &Keywords) {
-    static const std::unordered_set<StringRef> FoundationIdentifiers = {
+    static const llvm::ArrayRef<llvm::StringLiteral> FoundationIdentifiers = {
The ArrayRef doesn't own its contents, so this is a use-after-scope.

I'd prefer `static constexpr llvm::StringLiteral FoundationIdentifiers[] = {`

  rC Clang


More information about the cfe-commits mailing list