[clang] [Clang] disallow the use of asterisks preceding constructor and destructor names (PR #122621)
via cfe-commits
cfe-commits at lists.llvm.org
Sun Jan 12 05:45:47 PST 2025
================
@@ -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();
+ }
+ }
+}
+
----------------
cor3ntin wrote:
I know, my question is whether there is _any_ case where having more than one chunk would be valid?
https://github.com/llvm/llvm-project/pull/122621
More information about the cfe-commits
mailing list