forked from OSchip/llvm-project
Don't crash when codegen'ing an empty redecl of a function in C99 mode, when
neither was inline. Fixes bug introduced in r135377. llvm-svn: 135380
This commit is contained in:
parent
d8921f939c
commit
ba4cc01a1f
|
@ -1782,9 +1782,10 @@ bool FunctionDecl::doesDeclarationForceExternallyVisibleDefinition() const {
|
|||
return false;
|
||||
if (getLinkage() != ExternalLinkage || isInlineSpecified())
|
||||
return false;
|
||||
const FunctionDecl *InlineDefinition = 0;
|
||||
if (hasBody(InlineDefinition))
|
||||
return InlineDefinition->isInlineDefinitionExternallyVisible();
|
||||
const FunctionDecl *Definition = 0;
|
||||
if (hasBody(Definition))
|
||||
return Definition->isInlined() &&
|
||||
Definition->isInlineDefinitionExternallyVisible();
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -91,3 +91,9 @@ void test_test5() { test5(); }
|
|||
|
||||
__inline int test6() { return 0; }
|
||||
extern int test6();
|
||||
|
||||
|
||||
// No PR#, but this once crashed clang in C99 mode due to buggy extern inline
|
||||
// redeclaration detection.
|
||||
void test7() { }
|
||||
void test7();
|
||||
|
|
Loading…
Reference in New Issue