]> granicus.if.org Git - clang/commitdiff
Avoid spurious 'comma operator within array index expression' MSVC warning. NFCI.
authorSimon Pilgrim <llvm-dev@redking.me.uk>
Tue, 26 Jun 2018 15:20:20 +0000 (15:20 +0000)
committerSimon Pilgrim <llvm-dev@redking.me.uk>
Tue, 26 Jun 2018 15:20:20 +0000 (15:20 +0000)
Split the braces list initialization from the [] map operator to keep MSVC happy.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@335614 91177308-0d34-0410-b5e6-96231b3b80d8

lib/AST/ItaniumCXXABI.cpp

index 2403e048da3a2285ece6f0661e10cf20b69d0387..a75ae14f90155091b4e936b090838bf80cfe302f 100644 (file)
@@ -135,9 +135,10 @@ public:
 
   /// Variable decls are numbered by identifier.
   unsigned getManglingNumber(const VarDecl *VD, unsigned) override {
-    if (auto *DD = dyn_cast<DecompositionDecl>(VD))
-      return ++DecompsitionDeclManglingNumbers[
-          DecompositionDeclName{DD->bindings()}];
+    if (auto *DD = dyn_cast<DecompositionDecl>(VD)) {
+      DecompositionDeclName Name{DD->bindings()};
+      return ++DecompsitionDeclManglingNumbers[Name];
+    }
 
     const IdentifierInfo *Identifier = VD->getIdentifier();
     if (!Identifier) {