diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp --- a/clang/lib/CodeGen/CodeGenModule.cpp +++ b/clang/lib/CodeGen/CodeGenModule.cpp @@ -7230,7 +7230,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); diff --git a/clang/test/Interpreter/execute-weak.cpp b/clang/test/Interpreter/execute-weak.cpp --- a/clang/test/Interpreter/execute-weak.cpp +++ b/clang/test/Interpreter/execute-weak.cpp @@ -2,11 +2,17 @@ // RUN: clang-repl "int i = 10;" 'extern "C" int printf(const char*,...);' \ // RUN: 'auto r1 = printf("i = %d\n", i);' | FileCheck --check-prefix=CHECK-DRIVER %s // CHECK-DRIVER: i = 10 +// // UNSUPPORTED: system-aix, system-windows // RUN: cat %s | clang-repl | FileCheck %s + extern "C" int printf(const char *, ...); int __attribute__((weak)) bar() { return 42; } auto r4 = printf("bar() = %d\n", bar()); // CHECK: bar() = 42 +int a = 12; +static __typeof(a) b __attribute__((__weakref__("a"))); +int c = b; + %quit