[clang] [Clang] diagnose deleted/default redeclaration of defined friend functions (PR #136717)
Younan Zhang via cfe-commits
cfe-commits at lists.llvm.org
Thu Apr 24 06:24:17 PDT 2025
================
@@ -142,6 +142,14 @@ NamedDecl *Parser::ParseCXXInlineMethodDef(
SkipUntil(tok::semi);
}
+ if (FunctionDecl *FD =
+ dyn_cast_if_present<FunctionDecl>(FnD->getPreviousDecl())) {
+ if (isa<CXXRecordDecl>(FD->getLexicalDeclContext()) ||
+ Actions.getDefaultedFunctionKind(FD).asComparison() ==
+ Sema::DefaultedComparisonKind::None)
----------------
zyn0217 wrote:
> if cases like comparisons or declarations outside of scope are not skipped, these diagnostics will be replaced with a general redefinition diagnostic message
Then how specifically would the patch improve with this “skipping”? Could you please elaborate on the difference?
https://github.com/llvm/llvm-project/pull/136717
More information about the cfe-commits
mailing list