[clang] [clang] Fixed a crash when explicitly casting to atomic complex (PR #172163)

Amr Hesham via cfe-commits cfe-commits at lists.llvm.org
Sat Dec 13 07:51:44 PST 2025


AmrDeveloper wrote:

I was thinking of a utility or helper function to getComplexElementType because we have in many places casting type to complex directly without checking if it has an AtomicType wrapper, for example

```c++
ComplexPairTy ComplexExprEmitter::EmitComplexToComplexCast(ComplexPairTy Val,
                                                           QualType SrcType,
                                                           QualType DestType,
                                                           SourceLocation Loc) {
  // Get the src/dest element type.
  SrcType = SrcType->castAs<ComplexType>()->getElementType();
  DestType = DestType->castAs<ComplexType>()->getElementType();
```

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


More information about the cfe-commits mailing list