[cfe-commits] [PATCH] for bug 8181 (!&f compiles regardless of whether 'f' is overloaded)
Douglas Gregor
dgregor at apple.com
Mon Sep 20 10:15:28 PDT 2010
On Sep 18, 2010, at 11:20 AM, Faisal Vali wrote:
> This patch fixes the following bug(http://llvm.org/bugs/show_bug.cgi?id=8181):
>
> Clang compiles the following code when it should not:
> void f(); void f(int);
> bool b = !&f;
>
> The fix involves checking to see if the operand to '!' is an overloaded type,
> and to try and resolve it via a call to 'PerformContextuallyConvertToBool()'.
>
> I added some test cases, and tested against SemaCXX, Sema, SemaTemplate, CXX
>
> Will appreciate any feedback.
> Thanks!
Looks great, thanks! I applied as r114331 with a tiny bit of reformatting. Please feel free to close PR8181.
- Doug
More information about the cfe-commits
mailing list