r335614 - Avoid spurious 'comma operator within array index expression' MSVC warning. NFCI.

Simon Pilgrim via cfe-commits cfe-commits at lists.llvm.org
Tue Jun 26 08:20:20 PDT 2018


Author: rksimon
Date: Tue Jun 26 08:20:20 2018
New Revision: 335614

URL: http://llvm.org/viewvc/llvm-project?rev=335614&view=rev
Log:
Avoid spurious 'comma operator within array index expression' MSVC warning. NFCI.

Split the braces list initialization from the [] map operator to keep MSVC happy.

Modified:
    cfe/trunk/lib/AST/ItaniumCXXABI.cpp

Modified: cfe/trunk/lib/AST/ItaniumCXXABI.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/ItaniumCXXABI.cpp?rev=335614&r1=335613&r2=335614&view=diff
==============================================================================
--- cfe/trunk/lib/AST/ItaniumCXXABI.cpp (original)
+++ cfe/trunk/lib/AST/ItaniumCXXABI.cpp Tue Jun 26 08:20:20 2018
@@ -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) {




More information about the cfe-commits mailing list