Index: clang/lib/CodeGen/CodeGenModule.cpp =================================================================== --- clang/lib/CodeGen/CodeGenModule.cpp +++ clang/lib/CodeGen/CodeGenModule.cpp @@ -7232,7 +7232,6 @@ "Newly created module should not have manglings"); NewBuilder->Manglings = std::move(Manglings); - assert(WeakRefReferences.empty() && "Not all WeakRefRefs have been applied"); NewBuilder->WeakRefReferences = std::move(WeakRefReferences); NewBuilder->TBAA = std::move(TBAA); Index: clang/test/Interpreter/execute-weak.cpp =================================================================== --- clang/test/Interpreter/execute-weak.cpp +++ clang/test/Interpreter/execute-weak.cpp @@ -9,4 +9,7 @@ auto r4 = printf("bar() = %d\n", bar()); // CHECK: bar() = 42 +static int a() __attribute__((weakref("a"))); +int b = a(); + %quit