[clang] Thread Safety Analysis: Don't treat function pointer parameters as scoped capabilities (PR #211885)

Jameson Nash via cfe-commits cfe-commits at lists.llvm.org
Tue Jul 28 06:41:49 PDT 2026


vtjnash wrote:

indeed, it was a transient networking error and a unrelated test that is possibly racy

```
  FAIL: Clang :: ClangScanDeps/logging-two-threads.c (8664 of 25510)
  ******************** TEST 'Clang :: ClangScanDeps/logging-two-threads.c' FAILED ********************
  Exit Code: 1
  
  Command Output (stdout):
  --
  # RUN: at line 5
  rm -rf /home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/test/ClangScanDeps/Output/logging-two-threads.c.tmp
  # executed command: rm -rf /home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/test/ClangScanDeps/Output/logging-two-threads.c.tmp
  # note: command had no output on stdout or stderr
  # RUN: at line 6
  split-file /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/ClangScanDeps/logging-two-threads.c /home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/test/ClangScanDeps/Output/logging-two-threads.c.tmp
  # executed command: split-file /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/ClangScanDeps/logging-two-threads.c /home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/test/ClangScanDeps/Output/logging-two-threads.c.tmp
  # note: command had no output on stdout or stderr
  # RUN: at line 7
  sed -e "s|DIR|/home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/test/ClangScanDeps/Output/logging-two-threads.c.tmp|g" /home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/test/ClangScanDeps/Output/logging-two-threads.c.tmp/cdb.json.template > /home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/test/ClangScanDeps/Output/logging-two-threads.c.tmp/cdb.json
  # executed command: sed -e 's|DIR|/home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/test/ClangScanDeps/Output/logging-two-threads.c.tmp|g' /home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/test/ClangScanDeps/Output/logging-two-threads.c.tmp/cdb.json.template
  # note: command had no output on stdout or stderr
  # RUN: at line 9
  /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/clang-scan-deps -compilation-database /home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/test/ClangScanDeps/Output/logging-two-threads.c.tmp/cdb.json    -format experimental-full -log-path=/home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/test/ClangScanDeps/Output/logging-two-threads.c.tmp/scan.log -j 2 -o /home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/test/ClangScanDeps/Output/logging-two-threads.c.tmp/deps.json
  # executed command: /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/clang-scan-deps -compilation-database /home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/test/ClangScanDeps/Output/logging-two-threads.c.tmp/cdb.json -format experimental-full -log-path=/home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/test/ClangScanDeps/Output/logging-two-threads.c.tmp/scan.log -j 2 -o /home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/test/ClangScanDeps/Output/logging-two-threads.c.tmp/deps.json
  # note: command had no output on stdout or stderr
  # RUN: at line 13
  /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/FileCheck /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/ClangScanDeps/logging-two-threads.c --check-prefix=TU1 < /home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/test/ClangScanDeps/Output/logging-two-threads.c.tmp/scan.log
  # executed command: /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/FileCheck /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/ClangScanDeps/logging-two-threads.c --check-prefix=TU1
  # note: command had no output on stdout or stderr
  # RUN: at line 14
  /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/FileCheck /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/ClangScanDeps/logging-two-threads.c --check-prefix=TU2 < /home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/test/ClangScanDeps/Output/logging-two-threads.c.tmp/scan.log
  # executed command: /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/FileCheck /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/ClangScanDeps/logging-two-threads.c --check-prefix=TU2
  # note: command had no output on stdout or stderr
  # RUN: at line 24
  grep -c "pcm_compile:" /home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/test/ClangScanDeps/Output/logging-two-threads.c.tmp/scan.log | /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/FileCheck /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/ClangScanDeps/logging-two-threads.c --check-prefix=COMPILES
  # executed command: grep -c pcm_compile: /home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/test/ClangScanDeps/Output/logging-two-threads.c.tmp/scan.log
  # note: command had no output on stdout or stderr
  # executed command: /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/FileCheck /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/ClangScanDeps/logging-two-threads.c --check-prefix=COMPILES
  # note: command had no output on stdout or stderr
  # RUN: at line 25
  grep -c "pcm_write:" /home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/test/ClangScanDeps/Output/logging-two-threads.c.tmp/scan.log | /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/FileCheck /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/ClangScanDeps/logging-two-threads.c --check-prefix=PCMWRITES
  # executed command: grep -c pcm_write: /home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/test/ClangScanDeps/Output/logging-two-threads.c.tmp/scan.log
  # note: command had no output on stdout or stderr
  # executed command: /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/FileCheck /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/ClangScanDeps/logging-two-threads.c --check-prefix=PCMWRITES
  # note: command had no output on stdout or stderr
  # RUN: at line 26
  grep -c "timestamp_write:" /home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/test/ClangScanDeps/Output/logging-two-threads.c.tmp/scan.log | /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/FileCheck /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/ClangScanDeps/logging-two-threads.c --check-prefix=TSWRITES
  # executed command: grep -c timestamp_write: /home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/test/ClangScanDeps/Output/logging-two-threads.c.tmp/scan.log
  # note: command had no output on stdout or stderr
  # executed command: /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/FileCheck /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/ClangScanDeps/logging-two-threads.c --check-prefix=TSWRITES
  # .---command stderr------------
  # | /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/ClangScanDeps/logging-two-threads.c:29:14: error: TSWRITES: expected string not found in input
  # | // TSWRITES: {{^2$}}
  # |              ^
  # | <stdin>:1:1: note: scanning from here
  # | 3
  # | ^
  # | 
  # | Input file: <stdin>
  # | Check file: /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/ClangScanDeps/logging-two-threads.c
  # | 
  # | -dump-input=help explains the following input dump.
  # | 
  # | Input was:
  # | <<<<<<
  # |             1: 3 
  # | check:29'0    {  } search range (exclusive bounds)
  # | check:29'1         error: no match found in search range
  # | >>>>>>
  # `-----------------------------
  # error: command failed with exit status: 1
```

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


More information about the cfe-commits mailing list