[PATCH] Avoid llvm_unreachable when friend-ing a using declaration

Stephen Lin swlin at post.harvard.edu
Mon Mar 18 09:31:08 PDT 2013


Anyone able to review this? It's minor since it doesn't seem to affect
valid code, but still would like to get this fixed if my patch is OK....

Also, I've attached patch updated against the latest revision

Thanks,
Stephen

On Tue, Mar 12, 2013 at 5:30 PM, Stephen Lin <swlin at post.harvard.edu> wrote:

> Hi,
>
> This is a bug fix for LLVM Bugzilla bug #15485 (
> http://llvm.org/bugs/show_bug.cgi?id=15485)
>
> Basically, llvm_unreachable is currently hit because CheckOverload assumes
> that a new function declaration in record scope should trigger member
> function hiding rules, but this is not the case for "friend" declarations.
>
> I believe the code causing the issue is illegal (the friend declaration
> should not friend the function brought into scope by the using) and should
> result in an error; this is what happens after the patch without any extra
> effort (although the error could possibly be improved?).
>
> Please let me know if you have any comments.
>
> Best,
> Stephen
>
> P.S. The patch is in git diff format; hope that's ok
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20130318/312de3ba/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pr15485.patch
Type: application/octet-stream
Size: 1262 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20130318/312de3ba/attachment.obj>


More information about the cfe-commits mailing list