Don't get confused if a extern "C" builtin function is redeclared without

the extern "C".

llvm-svn: 171260
This commit is contained in:
Rafael Espindola 2012-12-30 17:23:09 +00:00
parent b6ad98224a
commit 5cab029e4b
2 changed files with 6 additions and 1 deletions

View File

@ -2440,7 +2440,7 @@ unsigned FunctionDecl::getMemoryFunctionKind() const {
return Builtin::BIstrlen;
default:
if (isExternC()) {
if (hasCLanguageLinkage()) {
if (FnInfo->isStr("memset"))
return Builtin::BImemset;
else if (FnInfo->isStr("memcpy"))

View File

@ -5,6 +5,11 @@ extern "C" void *memmove(void *s1, const void *s2, unsigned n);
extern "C" void *memcpy(void *s1, const void *s2, unsigned n);
extern "C" void *memcmp(void *s1, const void *s2, unsigned n);
// Redeclare without the extern "C" to test that we still figure out that this
// is the "real" memset.
void *memset(void *, int, unsigned);
// Several types that should not warn.
struct S1 {} s1;
struct S2 { int x; } s2;