This is an archive of the discontinued LLVM Phabricator instance.

Check for the overloadable attribute in all the appropriate syntactic locations
ClosedPublic

Authored by aaron.ballman on Feb 13 2022, 7:09 AM.

Details

Summary

When forming the function type from a declarator, we look for an overloadable attribute before issuing a diagnostic in C about a function signature containing only .... When the attribute is present, we allow such a declaration for compatibility with the overloading rules in C++. However, we were not looking for the attribute in all of the places it is legal to write it on a declarator and so we only accepted the signature in some forms and incorrectly rejected the signature in others.

We now check for the attribute preceding the declarator instead of only being applied to the declarator directly.

Diff Detail

Event Timeline

aaron.ballman requested review of this revision.Feb 13 2022, 7:09 AM
aaron.ballman created this revision.
Herald added a project: Restricted Project. · View Herald TranscriptFeb 13 2022, 7:09 AM
cor3ntin accepted this revision.Feb 13 2022, 8:48 AM

LGTM
(I didn't know can_overload_4 was a valid place to put a C attribute)

This revision is now accepted and ready to land.Feb 13 2022, 8:48 AM