================
@@ -11889,6 +11889,13 @@ bool Sema::CheckFunctionDeclaration(Scope *S,
FunctionDecl *NewFD,
NewFD->setInvalidDecl();
}
+ if (NewFD->hasAttr<PureAttr>() || NewFD->hasAttr<ConstAttr>()) {
+ if (isa<CXXConstructorDecl>(NewFD))
+ Diag(NewFD->getLocation(), diag::warn_pure_attr_on_cxx_constructor);
+ else if (NewFD->getReturnType()->isVoidType())
----------------
ChuanqiXu9 wrote:
Also let's get some comments for the rationale here even if you feel it is
obivious.
https://github.com/llvm/llvm-project/pull/78200
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits