================ @@ -10757,6 +10757,17 @@ static void checkMethodTypeQualifiers(Sema &S, Declarator &D, unsigned DiagID) { } } +static void checkMethodPointerType(Sema &S, Declarator &D, unsigned DiagID) { + if (D.getNumTypeObjects() > 0) { + DeclaratorChunk &Chunk = D.getTypeObject(D.getNumTypeObjects() - 1); + if (Chunk.Kind == DeclaratorChunk::Pointer) { + SourceLocation PointerLoc = Chunk.getSourceRange().getBegin(); + S.Diag(PointerLoc, DiagID) << Chunk.getSourceRange(); + D.setInvalidType(); + } + } +} + ---------------- a-tarasyuk wrote:
Do you mean that having more than one chunk should, by default, be considered an error? I thought about that, however, I opted to use the appropriate kind check to ensure cases like this are handled correctly (the helper is used for constructors and destructors). ```cpp struct S { (~S)(); }; ``` https://github.com/llvm/llvm-project/pull/122621 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits