[clang] [Clang] Handle deduced auto types within AtomicType (PR #197874)

via cfe-commits cfe-commits at lists.llvm.org
Sat Jun 27 02:39:56 PDT 2026


================
@@ -5112,6 +5118,19 @@ namespace {
       return Result;
     }
 
+    QualType TransformAtomicType(TypeLocBuilder &TLB, AtomicTypeLoc TL) {
+      // When building the function parameter for placeholder type deduction
+      // (Replacement is the invented template parameter), dig through _Atomic
+      // around an auto placeholder so deduction matches the non-atomic
+      // argument. The _Atomic wrapper is re-applied by the final substitution
+      // pass, which uses a concrete Replacement and falls through to the
+      // default transform.
+      if (!Replacement.isNull() && Replacement->isTemplateTypeParmType() &&
+          TL.getValueLoc().getType()->getContainedAutoType())
+        return getDerived().TransformType(TLB, TL.getValueLoc());
+      return inherited::TransformAtomicType(TLB, TL);
----------------
mkovacevic99 wrote:

thanks for this, I added a comment for future reference

https://github.com/llvm/llvm-project/pull/197874


More information about the cfe-commits mailing list