[PATCH] D32332: Add support for transparent overloadable functions in clang
George Burgess IV via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Wed May 24 21:07:32 PDT 2017
george.burgess.iv updated this revision to Diff 100201.
george.burgess.iv added a comment.
Herald added a subscriber: jfb.
Fix the aforementioned issue; PTAL.
Note that this fix is slightly backwards incompatible. It disallows code like:
void foo(int) __attribute__((overloadable)); // first decl lacked overloadable, so this one must lack it, as well.
I chose to do it this way because r64414 wanted to make us reject code like:
double sin(double) __attribute__((overloadable));
#include <math.h> // error: sin redecl without overloadable
...but it was trivial to get around that by moving the overloadable `sin` decl below the include. So, I feel like us accepting the first code snippet is a small bug.
I tested this change on ChromeOS, which uses `overloadable` in some parts of its C standard library. This backwards incompatibility caused no build breakages on that platform.
If we'd rather stay as backwards-compatible as possible, I have no issues with tweaking this to allow the first example.
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 28026 bytes
Desc: not available
More information about the cfe-commits