diff --git a/clang/lib/AST/Decl.cpp b/clang/lib/AST/Decl.cpp --- a/clang/lib/AST/Decl.cpp +++ b/clang/lib/AST/Decl.cpp @@ -3348,8 +3348,8 @@ /// an externally visible symbol, but "extern inline" will not create an /// externally visible symbol. bool FunctionDecl::isInlineDefinitionExternallyVisible() const { - assert((doesThisDeclarationHaveABody() || willHaveBody()) && - "Must be a function definition"); + assert((doesThisDeclarationHaveABody() || willHaveBody()) || + hasAttr() && "Must be a function definition"); assert(isInlined() && "Function must be inline"); ASTContext &Context = getASTContext(); diff --git a/clang/test/CodeGen/alias.c b/clang/test/CodeGen/alias.c --- a/clang/test/CodeGen/alias.c +++ b/clang/test/CodeGen/alias.c @@ -99,3 +99,8 @@ // CHECKGLOBALS-NOT: @test11_foo = dso_local void test11(void) {} static void test11_foo(void) __attribute__((alias("test11"))); + +// Test that gnu_inline+alias work. +// CHECKGLOBALS: @test12_alias = alias void (), void ()* @test12 +void test12(void) {} +inline void test12_alias(void) __attribute__((gnu_inline, alias("test12")));