This is an archive of the discontinued LLVM Phabricator instance.

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 foo {

namespace log {}

}
using namespace foo;
void bar(int i) {

log((double)i);

}

Diff Detail

Repository
rL LLVM

Event Timeline

mehdi_amini created this revision.Feb 9 2017, 6:15 PM
EricWF edited edge metadata.Feb 9 2017, 6:43 PM

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
may not tolerate them.

This revision was automatically updated to reflect the committed changes.