Kristianerik wrote:

@cor3ntin I Dug into this a bit more. Both ss.foo() and ss.bar() have the 
CK_AtomicToNonAtomic cast in the AST at parse time, confirmed with -ast-dump, 
so the cast is present for both initially. The difference happens later for 
consteval members, RemoveNestedImmediateInvocation transforms the expression, 
and TransformImplicitCastExpr strips all implicit casts by design, expecting 
them to be recomputed. When the expression is rebuilt via RebuildMemberExpr 
calling PerformMemberExprBaseConversion, there is no atomic handling, so the 
cast is never reinserted. That is where the non-qualified type gets lost.
CK_AtomicToNonAtomic is also inserted in SemaExpr.cpp and SemaExprCXX.cpp, so 
those paths could potentially have the same issue. The fix probably belongs in 
PerformMemberExprBaseConversion or RebuildMemberExpr rather than in 
TryObjectArgumentInitialization. Happy to update the patch if you agree with 
the analysis.

https://github.com/llvm/llvm-project/pull/207042
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to