parent
2543dc97d2
commit
53cd3dc665
|
@ -75,6 +75,9 @@ void CheckUnusedFunctions::parseTokens(const Tokenizer &tokenizer, const char Fi
|
||||||
if (func->isAttributeConstructor() || func->isAttributeDestructor() || func->type != Function::eFunction || func->isOperator())
|
if (func->isAttributeConstructor() || func->isAttributeDestructor() || func->type != Function::eFunction || func->isOperator())
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
if (func->isExtern())
|
||||||
|
continue;
|
||||||
|
|
||||||
// Don't care about templates
|
// Don't care about templates
|
||||||
if (tokenizer.isCPP() && func->templateDef != nullptr)
|
if (tokenizer.isCPP() && func->templateDef != nullptr)
|
||||||
continue;
|
continue;
|
||||||
|
|
|
@ -2451,7 +2451,7 @@ const Token *Function::setFlags(const Token *tok1, const Scope *scope)
|
||||||
isInlineKeyword(true);
|
isInlineKeyword(true);
|
||||||
|
|
||||||
// extern function
|
// extern function
|
||||||
if (tok1->str() == "extern") {
|
if (tok1->isExternC() || tok1->str() == "extern") {
|
||||||
isExtern(true);
|
isExtern(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -394,6 +394,10 @@ private:
|
||||||
// Don't crash on wrong syntax
|
// Don't crash on wrong syntax
|
||||||
check("int x __attribute__((constructor));\n"
|
check("int x __attribute__((constructor));\n"
|
||||||
"int y __attribute__((destructor));");
|
"int y __attribute__((destructor));");
|
||||||
|
|
||||||
|
// #10661
|
||||||
|
check("extern \"C\" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t dataSize) { return 0; }\n");
|
||||||
|
ASSERT_EQUALS("", errout.str());
|
||||||
}
|
}
|
||||||
|
|
||||||
void initializer_list() {
|
void initializer_list() {
|
||||||
|
|
Loading…
Reference in New Issue