[clang] Make -Wpadded cause us to check the layout immediately, always checking (PR #206820)

Aaron Ballman via cfe-commits cfe-commits at lists.llvm.org
Wed Jul 1 04:44:57 PDT 2026


AaronBallman wrote:

> > # 🪟 Windows x64 Test Results
> > ```
> > * 54213 tests passed
> > 
> > * 1362 tests skipped
> > 
> > * 1 test failed
> > ```
> > 
> > 
> >     
> >       
> >     
> > 
> >       
> >     
> > 
> >     
> >   
> > ## Failed Tests
> > (click on a test name to see its output)
> > ### Clang
> > Clang.Modules/diag-flags.cpp
> > ```
> > Exit Code: 1
> > 
> > Command Output (stdout):
> > --
> > # RUN: at line 1
> > rm -rf C:\_work\llvm-project\llvm-project\build\tools\clang\test\Modules\Output\diag-flags.cpp.tmp
> > # executed command: rm -rf 'C:\_work\llvm-project\llvm-project\build\tools\clang\test\Modules\Output\diag-flags.cpp.tmp'
> > # 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 -triple x86_64-pc-windows-gnu -fmodules -fimplicit-module-maps -emit-module -fmodules-cache-path=C:\_work\llvm-project\llvm-project\build\tools\clang\test\Modules\Output\diag-flags.cpp.tmp -fmodule-name=diag_flags -x c++ C:\_work\llvm-project\llvm-project\clang\test\Modules/Inputs/module.modulemap -std=c++20
> > # 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 -triple x86_64-pc-windows-gnu -fmodules -fimplicit-module-maps -emit-module '-fmodules-cache-path=C:\_work\llvm-project\llvm-project\build\tools\clang\test\Modules\Output\diag-flags.cpp.tmp' -fmodule-name=diag_flags -x c++ 'C:\_work\llvm-project\llvm-project\clang\test\Modules/Inputs/module.modulemap' -std=c++20
> > # note: command had no output on stdout or stderr
> > # RUN: at line 5
> > 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 -triple x86_64-pc-windows-gnu -fmodules -fimplicit-module-maps -verify -fmodules-cache-path=C:\_work\llvm-project\llvm-project\build\tools\clang\test\Modules\Output\diag-flags.cpp.tmp -I C:\_work\llvm-project\llvm-project\clang\test\Modules/Inputs C:\_work\llvm-project\llvm-project\clang\test\Modules\diag-flags.cpp -std=c++20
> > # 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 -triple x86_64-pc-windows-gnu -fmodules -fimplicit-module-maps -verify '-fmodules-cache-path=C:\_work\llvm-project\llvm-project\build\tools\clang\test\Modules\Output\diag-flags.cpp.tmp' -I 'C:\_work\llvm-project\llvm-project\clang\test\Modules/Inputs' 'C:\_work\llvm-project\llvm-project\clang\test\Modules\diag-flags.cpp' -std=c++20
> > # note: command had no output on stdout or stderr
> > # RUN: at line 6
> > 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 -triple x86_64-pc-windows-gnu -fmodules -fimplicit-module-maps -verify -fmodules-cache-path=C:\_work\llvm-project\llvm-project\build\tools\clang\test\Modules\Output\diag-flags.cpp.tmp -I C:\_work\llvm-project\llvm-project\clang\test\Modules/Inputs C:\_work\llvm-project\llvm-project\clang\test\Modules\diag-flags.cpp -std=c++20 -DWARNING -DLOCAL_WARNING -Wpadded
> > # 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 -triple x86_64-pc-windows-gnu -fmodules -fimplicit-module-maps -verify '-fmodules-cache-path=C:\_work\llvm-project\llvm-project\build\tools\clang\test\Modules\Output\diag-flags.cpp.tmp' -I 'C:\_work\llvm-project\llvm-project\clang\test\Modules/Inputs' 'C:\_work\llvm-project\llvm-project\clang\test\Modules\diag-flags.cpp' -std=c++20 -DWARNING -DLOCAL_WARNING -Wpadded
> > # note: command had no output on stdout or stderr
> > # RUN: at line 7
> > 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 -triple x86_64-pc-windows-gnu -fmodules -fimplicit-module-maps -verify -fmodules-cache-path=C:\_work\llvm-project\llvm-project\build\tools\clang\test\Modules\Output\diag-flags.cpp.tmp -I C:\_work\llvm-project\llvm-project\clang\test\Modules/Inputs C:\_work\llvm-project\llvm-project\clang\test\Modules\diag-flags.cpp -std=c++20 -DERROR -DLOCAL_ERROR -Wpadded -Werror
> > # 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 -triple x86_64-pc-windows-gnu -fmodules -fimplicit-module-maps -verify '-fmodules-cache-path=C:\_work\llvm-project\llvm-project\build\tools\clang\test\Modules\Output\diag-flags.cpp.tmp' -I 'C:\_work\llvm-project\llvm-project\clang\test\Modules/Inputs' 'C:\_work\llvm-project\llvm-project\clang\test\Modules\diag-flags.cpp' -std=c++20 -DERROR -DLOCAL_ERROR -Wpadded -Werror
> > # .---command stderr------------
> > # | error: 'expected-error' diagnostics expected but not seen: 
> > # |   File C:\_work\llvm-project\llvm-project\clang\test\Modules/Inputs\diag_flags.h Line 4 (directive at C:\_work\llvm-project\llvm-project\clang\test\Modules\diag-flags.cpp:38): padding struct
> > # |   File C:\_work\llvm-project\llvm-project\clang\test\Modules\diag-flags.cpp Line 51 (directive at C:\_work\llvm-project\llvm-project\clang\test\Modules\diag-flags.cpp:47): padding struct
> > # | error: 'expected-error' diagnostics seen but not expected: 
> > # |   File C:\_work\llvm-project\llvm-project\clang\test\Modules\diag-flags.cpp Line 33: could not build module 'diag_flags'
> > # | 3 errors generated.
> > # `-----------------------------
> > # error: command failed with exit status: 1
> > 
> > --
> > ```
> > 
> > 
> >     
> >       
> >     
> > 
> >       
> >     
> > 
> >     
> >   
> > 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.
> 
> Hmm... its not clear what is happening here. I don't have much knowledge of what this test is trying to do, or know really how I could have affected this one, but based on our build bots, it seems pretty clear that I broke this one.

CC @ChuanqiXu9 @Bigcheese for opinions

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


More information about the cfe-commits mailing list