Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion clang/lib/Sema/SemaExprMember.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,9 @@ static void diagnoseInstanceReference(Sema &SemaRef,
SemaRef.Diag(Loc, diag::err_member_call_without_object)
<< Range << /*static*/ 0;
else {
const auto *Callee = dyn_cast<CXXMethodDecl>(Rep);
if (const auto *Tpl = dyn_cast<FunctionTemplateDecl>(Rep))
Rep = Tpl->getTemplatedDecl();
const auto *Callee = cast<CXXMethodDecl>(Rep);
auto Diag = SemaRef.Diag(Loc, diag::err_member_call_without_object)
<< Range << Callee->isExplicitObjectMemberFunction();
if (!Replacement.empty())
Expand Down
10 changes: 10 additions & 0 deletions clang/test/SemaCXX/cxx2b-deducing-this.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -626,3 +626,13 @@ void test() {
}

}


namespace GH75732 {
auto serialize(auto&& archive, auto&& c){ }
struct D {
auto serialize(this auto&& self, auto&& archive) {
serialize(archive, self); // expected-error {{call to explicit member function without an object argument}}
}
};
}