This is an archive of the discontinued LLVM Phabricator instance.

[Frontend] Don't skip function body when the return type is dependent on the template parameter.
AbandonedPublic

Authored by hokein on May 10 2018, 3:26 AM.

Details

Reviewers
ilya-biryukov
Summary

Otherwise clang will provide an unexpected diagnostic error.

Diff Detail

Event Timeline

hokein created this revision.May 10 2018, 3:26 AM
rsmith added a subscriber: rsmith.May 10 2018, 7:44 AM
rsmith added inline comments.
lib/Sema/SemaDecl.cpp
12645

This is a lot broader than necessary; what we should do is to look for a deduced type in the return type. isUndeducedType doesn't quite do that for a template because we "deduce" the auto as a dependent type early.

rwols added a subscriber: rwols.May 10 2018, 2:42 PM
ilya-biryukov added inline comments.May 11 2018, 7:20 AM
lib/Sema/SemaDecl.cpp
12645

My change from some time ago (D44480) seem to do exactly that. Could you take a look?

hokein abandoned this revision.Jun 4 2018, 4:41 AM

Abandon this, since @ilya-biryukov has fixed it in D44480.