[all-commits] [llvm/llvm-project] 8bdf13: [ObjC] Name lookup in methods shouldn't allow shad...
apple-fcloutier via All-commits
all-commits at lists.llvm.org
Tue Nov 19 10:33:56 PST 2024
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 8bdf13b11638d2f3e6792a573fc2be830a03790a
https://github.com/llvm/llvm-project/commit/8bdf13b11638d2f3e6792a573fc2be830a03790a
Author: apple-fcloutier <75502309+apple-fcloutier at users.noreply.github.com>
Date: 2024-11-19 (Tue, 19 Nov 2024)
Changed paths:
M clang/lib/Parse/ParseObjc.cpp
A clang/test/SemaObjC/method-param-named-id.m
Log Message:
-----------
[ObjC] Name lookup in methods shouldn't allow shadowing types (#116683)
Arguably as a bug, Clang has previously not mixed up Objective-C
parameter names with types. This allows developers to write parameter
names that _should_ shadow type names, but don't. For instance:
@interface Foo
-(void)foo:(int)id bar:(id)name; // OK
@end
Commit 97788089988a2ace63d717cadbcfe3443f380f9c changed the way that
parameters are parsed to bring it more in line with how C parameters are
parsed, but it breaks the example above. Given an expectation that the
change wouldn't introduce source breaks, this is not something we can go
forward with.
97788089988a2ace63d717cadbcfe3443f380f9c did this so that late-parsed
attributes could reference Objective-C parameters. This change buffers
Objective-C parameter info until after all parameters are parsed and
turns them into parameter declarations before realizing late-parsed
attributes instead.
Radar-ID: 139996306
To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications
More information about the All-commits
mailing list