[clang] [Clang] Fix isWeakImported() to traverse redeclaration chain for avai… (PR #181482)

via cfe-commits cfe-commits at lists.llvm.org
Tue May 5 00:18:45 PDT 2026


github-actions[bot] wrote:

<!--PREMERGE ADVISOR COMMENT: Windows-->
# :window: Windows x64 Test Results

* 53776 tests passed
* 1178 tests skipped
* 1 test failed

## Failed Tests
(click on a test name to see its output)

### Clang
<details>
<summary>Clang.Modules/decl-attr-merge.mm</summary>

```
Exit Code: 1

Command Output (stdout):
--
# RUN: at line 1
rm -rf C:\_work\llvm-project\llvm-project\build\tools\clang\test\Modules\Output\decl-attr-merge.mm.tmp.dir
# executed command: rm -rf 'C:\_work\llvm-project\llvm-project\build\tools\clang\test\Modules\Output\decl-attr-merge.mm.tmp.dir'
# note: command had no output on stdout or stderr
# RUN: at line 2
split-file C:\_work\llvm-project\llvm-project\clang\test\Modules\decl-attr-merge.mm C:\_work\llvm-project\llvm-project\build\tools\clang\test\Modules\Output\decl-attr-merge.mm.tmp.dir
# executed command: split-file 'C:\_work\llvm-project\llvm-project\clang\test\Modules\decl-attr-merge.mm' 'C:\_work\llvm-project\llvm-project\build\tools\clang\test\Modules\Output\decl-attr-merge.mm.tmp.dir'
# note: command had no output on stdout or stderr
# RUN: at line 4
c:\_work\llvm-project\llvm-project\build\bin\clang.exe -cc1 -internal-isystem C:\_work\llvm-project\llvm-project\build\lib\clang\23\include -nostdsysteminc -fmodules -fimplicit-module-maps    -fmodules-cache-path=C:\_work\llvm-project\llvm-project\build\tools\clang\test\Modules\Output\decl-attr-merge.mm.tmp.dir/mcache -triple x86_64-apple-macosx10.11.0    -IC:\_work\llvm-project\llvm-project\build\tools\clang\test\Modules\Output\decl-attr-merge.mm.tmp.dir/headers C:\_work\llvm-project\llvm-project\build\tools\clang\test\Modules\Output\decl-attr-merge.mm.tmp.dir/main-macos.m -emit-llvm -o - | c:\_work\llvm-project\llvm-project\build\bin\filecheck.exe C:\_work\llvm-project\llvm-project\clang\test\Modules\decl-attr-merge.mm
# executed command: 'c:\_work\llvm-project\llvm-project\build\bin\clang.exe' -cc1 -internal-isystem 'C:\_work\llvm-project\llvm-project\build\lib\clang\23\include' -nostdsysteminc -fmodules -fimplicit-module-maps '-fmodules-cache-path=C:\_work\llvm-project\llvm-project\build\tools\clang\test\Modules\Output\decl-attr-merge.mm.tmp.dir/mcache' -triple x86_64-apple-macosx10.11.0 '-IC:\_work\llvm-project\llvm-project\build\tools\clang\test\Modules\Output\decl-attr-merge.mm.tmp.dir/headers' 'C:\_work\llvm-project\llvm-project\build\tools\clang\test\Modules\Output\decl-attr-merge.mm.tmp.dir/main-macos.m' -emit-llvm -o -
# note: command had no output on stdout or stderr
# executed command: 'c:\_work\llvm-project\llvm-project\build\bin\filecheck.exe' 'C:\_work\llvm-project\llvm-project\clang\test\Modules\decl-attr-merge.mm'
# .---command stderr------------
# | C:\_work\llvm-project\llvm-project\clang\test\Modules\decl-attr-merge.mm:59:11: error: CHECK: expected string not found in input
# | // CHECK: @"OBJC_CLASS_$_INIntent" = extern_weak
# |           ^
# | <stdin>:8:39: note: scanning from here
# | @"OBJC_CLASS_$_INIntent" = extern_weak global %struct._class_t
# |                                       ^
# | <stdin>:9:55: note: possible intended match here
# | @"OBJC_CLASSLIST_REFERENCES_$_" = internal global ptr @"OBJC_CLASS_$_INIntent", section "__DATA,__objc_classrefs,regular,no_dead_strip", align 8
# |                                                       ^
# | 
# | Input file: <stdin>
# | Check file: C:\_work\llvm-project\llvm-project\clang\test\Modules\decl-attr-merge.mm
# | 
# | -dump-input=help explains the following input dump.
# | 
# | Input was:
# | <<<<<<
# |             1: ; ModuleID = 'C:\_work\llvm-project\llvm-project\build\tools\clang\test\Modules\Output\decl-attr-merge.mm.tmp.dir/main-macos.m' 
# |             2: source_filename = "C:\\_work\\llvm-project\\llvm-project\\build\\tools\\clang\\test\\Modules\\Output\\decl-attr-merge.mm.tmp.dir/main-macos.m" 
# |             3: target datalayout = "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128" 
# |             4: target triple = "x86_64-apple-macosx10.11.0" 
# |             5:  
# |             6: %struct._class_t = type { ptr, ptr, ptr, ptr, ptr } 
# |             7:  
# |             8: @"OBJC_CLASS_$_INIntent" = extern_weak global %struct._class_t 
# | check:59'0                                           X~~~~~~~~~~~~~~~~~~~~~~~~ error: no match found
# |             9: @"OBJC_CLASSLIST_REFERENCES_$_" = internal global ptr @"OBJC_CLASS_$_INIntent", section "__DATA,__objc_classrefs,regular,no_dead_strip", align 8 
# | check:59'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# | check:59'1                                                           ?                                                                                           possible intended match
# |            10: @OBJC_METH_VAR_NAME_ = private unnamed_addr constant [5 x i8] c"self\00", section "__TEXT,__objc_methname,cstring_literals", align 1 
# | check:59'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |            11: @OBJC_SELECTOR_REFERENCES_ = internal externally_initialized global ptr @OBJC_METH_VAR_NAME_, section "__DATA,__objc_selrefs,literal_pointers,no_dead_strip", align 8 
# | check:59'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |            12: @llvm.compiler.used = appending global [4 x ptr] [ptr @"OBJC_CLASSLIST_REFERENCES_$_", ptr @OBJC_METH_VAR_NAME_, ptr @OBJC_SELECTOR_REFERENCES_, ptr @__clang_at_available_requires_core_foundation_framework], section "llvm.metadata" 
# | check:59'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |            13:  
# | check:59'0     ~
# |            14: ; Function Attrs: noinline nounwind optnone 
# | check:59'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |             .
# |             .
# |             .
# | >>>>>>
# `-----------------------------
# error: command failed with exit status: 1

--

```
</details>

If these failures are unrelated to your changes (for example tests are broken or flaky at HEAD), please open an issue at https://github.com/llvm/llvm-project/issues and add the `infrastructure` label.

https://github.com/llvm/llvm-project/pull/181482


More information about the cfe-commits mailing list