This can cause a compile failure in cases like:
double log(double);
namespace foo {
namespace log {}
}
using namespace foo;
void bar(int i) {
log((double)i);
}
Differential D29804
Fully qualify (preprend ::) calls to math functions from libc ClosedPublic Authored by mehdi_amini on Feb 9 2017, 6:15 PM.
Details Summary This can cause a compile failure in cases like: double log(double); namespace log {} } log((double)i); }
Diff Detail
Event TimelineComment Actions This LGTM. Although IDK how far we should go to tolerate collisions with imported namespace names, especially since libc can't (since they can't add the ::qualifier). I've wrote tests for this change here. However I don't think they can be applied, since libc implementations Closed by commit rL294696: Fully qualify (preprend ::) calls to math functions from libc (authored by mehdi_amini). · Explain WhyFeb 9 2017, 6:55 PM This revision was automatically updated to reflect the committed changes.
Revision Contents
Diff 87933 libcxx/include/math.h
|