This is an archive of the discontinued LLVM Phabricator instance.

Diagnose invalid cv-qualifiers for friend decls.
ClosedPublic

Authored by efriedma on Apr 16 2018, 6:38 PM.

Diff Detail

Repository
rC Clang

Event Timeline

efriedma created this revision.Apr 16 2018, 6:38 PM
efriedma updated this revision to Diff 154471.Jul 6 2018, 4:11 PM
efriedma retitled this revision from [WIP] Diagnose invalid cv-qualifiers for friend decls. to Diagnose invalid cv-qualifiers for friend decls..
efriedma edited the summary of this revision. (Show Details)

Updated to handle the template case.

rsmith added a comment.Jul 7 2018, 5:39 PM

Can we avoid the duplication by putting this check in Sema::ParsedFreeStandingDeclSpec instead?

I thought the template case wasn't using the same codepath, but apparently I was just confusing myself. The exact form "template <typename T> friend class Y;" triggers an early out in Sema::ActOnFriendTypeDecl, so my code wasn't getting hit. I'll revise accordingly.

efriedma updated this revision to Diff 154707.Jul 9 2018, 2:59 PM
efriedma edited the summary of this revision. (Show Details)

Move declspec checks before call to GetTypeForDeclarator, since it can fail for class templates.

rsmith accepted this revision.Jul 25 2018, 5:30 PM
This revision is now accepted and ready to land.Jul 25 2018, 5:30 PM
This revision was automatically updated to reflect the committed changes.