[clang] Fix extra error message (#222605) (PR #235427)
via cfe-commits
cfe-commits at lists.llvm.org
Thu Oct 29 00:58:32 PDT 2026
================
@@ -877,8 +878,30 @@ Sema::ActOnDecompositionDeclarator(Scope *S, Declarator &D,
// In most cases, there's no actual problem with an explicitly-specified
// type, but a function type won't work here, and ActOnVariableDeclarator
- // shouldn't be called for such a type.
- if (R->isFunctionType())
+ // shouldn't be called for such a type.
+ // Recover from invalid pointer declarators by removing pointer chunks
+ // so type deduction can proceed and the bindings remain usable.
+ bool DroppedPointer = false;
+ for (unsigned I = D.getNumTypeObjects(); I > 0; --I) {
----------------
Murthy-Manideep wrote:
I agree with your suggestion. I’ll update the codes to handle only a simple auto * declaration.
https://github.com/llvm/llvm-project/pull/235427
More information about the cfe-commits
mailing list