[clang] 46135ad - [Sema] On Windows, silence erroneous warning when building with MSVC

Alexandre Ganea via cfe-commits cfe-commits at lists.llvm.org
Fri Apr 11 14:51:08 PDT 2025


Author: Alexandre Ganea
Date: 2025-04-11T17:50:15-04:00
New Revision: 46135ade9ec0b7fd975b5d3923aea95f4d416296

URL: https://github.com/llvm/llvm-project/commit/46135ade9ec0b7fd975b5d3923aea95f4d416296
DIFF: https://github.com/llvm/llvm-project/commit/46135ade9ec0b7fd975b5d3923aea95f4d416296.diff

LOG: [Sema] On Windows, silence erroneous warning when building with MSVC

Fixes what seems to be a buggy warning in MSVC:
```
[1/37] Building CXX object tools\clang\lib\Sema\CMakeFiles\obj.clangSema.dir\SemaConcept.cpp.obj
C:\git\llvm-project\clang\lib\Sema\SemaConcept.cpp(1933): warning C4101: '$S26': unreferenced local variable
```

Added: 
    

Modified: 
    clang/lib/Sema/SemaConcept.cpp

Removed: 
    


################################################################################
diff  --git a/clang/lib/Sema/SemaConcept.cpp b/clang/lib/Sema/SemaConcept.cpp
index 011a6d072d35c..73bc8731af57d 100644
--- a/clang/lib/Sema/SemaConcept.cpp
+++ b/clang/lib/Sema/SemaConcept.cpp
@@ -1929,11 +1929,11 @@ auto SubsumptionChecker::find(AtomicConstraint *Ori) -> Literal {
   }
   auto It = Elems.find(ID);
   if (It == Elems.end()) {
-    It =
-        Elems
-            .insert({ID, MappedAtomicConstraint{Ori, Literal{getNewLiteralId(),
-                                                             Literal::Atomic}}})
-            .first;
+    It = Elems
+             .insert({ID,
+                      MappedAtomicConstraint{
+                          Ori, {getNewLiteralId(), Literal::Atomic}}})
+             .first;
     ReverseMap[It->second.ID.Value] = Ori;
   }
   return It->getSecond().ID;


        


More information about the cfe-commits mailing list