[clang] [clang] Fix CTAD not work for C++ explicit type conversion (functional annotation). (PR #75779)

Haojian Wu via cfe-commits cfe-commits at lists.llvm.org
Mon Dec 18 03:37:06 PST 2023


hokein wrote:

> Why remove the support for ParenListExpr entirely? Could you not fallback on looking at the init list expression only when ParenListExpr is null?

We could keep `ParenListExpr`,  but I'm not sure the benefit (IMO, removing it seems like an API improvement, and make code simpler). The `ParenListExpr` is redundant with the existing `Inits` parameter to some degree, the only benefit to use it is for the precise `()` location information (as we deduct the template type here, I think it is fine to use a less-precise source location).

Looking at all usages (total 4) of `DeduceTemplateSpecializationFromInitializer` in clang, only 1 [place](https://github.com/llvm/llvm-project/blob/main/clang/lib/Sema/SemaDecl.cpp#L12959) passes the `ParenListExpr`. 

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


More information about the cfe-commits mailing list