[clang] [clang] add test verifying DR242 behavior (PR #201441)

via cfe-commits cfe-commits at lists.llvm.org
Thu Jun 18 00:45:46 PDT 2026


github-actions[bot] wrote:

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

* 54121 tests passed
* 1291 tests skipped
* 1 test failed

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

### Clang
<details>
<summary>Clang.CXX/drs/cwg2xx.cpp</summary>

```
Exit Code: 1

Command Output (stdout):
--
# RUN: at line 1
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 -std=c++98 C:\_work\llvm-project\llvm-project\clang\test\CXX\drs\cwg2xx.cpp -fexceptions -fcxx-exceptions -pedantic-errors -verify-directives -verify=expected,cxx98,cxx98-11,cxx98-14,cxx98-17
# 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 -std=c++98 'C:\_work\llvm-project\llvm-project\clang\test\CXX\drs\cwg2xx.cpp' -fexceptions -fcxx-exceptions -pedantic-errors -verify-directives -verify=expected,cxx98,cxx98-11,cxx98-14,cxx98-17
# .---command stderr------------
# | error: diagnostics with 'error' severity expected but not seen: 
# |   File C:\_work\llvm-project\llvm-project\clang\test\CXX\drs\cwg2xx.cpp Line 705 (directive at C:\_work\llvm-project\llvm-project\clang\test\CXX\drs\cwg2xx.cpp:706) 'expected-error': error: ambiguous conversion from derived class 'cwg242::D' to base class 'cwg242::A'
# |   File C:\_work\llvm-project\llvm-project\clang\test\CXX\drs\cwg2xx.cpp Line 723 (directive at C:\_work\llvm-project\llvm-project\clang\test\CXX\drs\cwg2xx.cpp:724) 'expected-error': ambiguous conversion from derived class 'cwg242::D' to base class 'cwg242::A'
# |   File C:\_work\llvm-project\llvm-project\clang\test\CXX\drs\cwg2xx.cpp Line 728 (directive at C:\_work\llvm-project\llvm-project\clang\test\CXX\drs\cwg2xx.cpp:729) 'expected-error': ambiguous conversion from pointer to member of base class 'cwg242::A' to pointer to member of derived class 'cwg242::D'
# | error: diagnostics with 'error' severity seen but not expected: 
# |   File C:\_work\llvm-project\llvm-project\clang\test\CXX\drs\cwg2xx.cpp Line 705: ambiguous conversion from derived class 'D' to base class 'A':
# |     struct cwg242::D -> I1 -> A
# |     struct cwg242::D -> I2 -> A
# |   File C:\_work\llvm-project\llvm-project\clang\test\CXX\drs\cwg2xx.cpp Line 723: ambiguous conversion from derived class 'D' to base class 'A':
# |     struct cwg242::D -> I1 -> A
# |     struct cwg242::D -> I2 -> A
# |   File C:\_work\llvm-project\llvm-project\clang\test\CXX\drs\cwg2xx.cpp Line 728: ambiguous conversion from pointer to member of base class 'A' to pointer to member of derived class 'D':
# |     struct cwg242::D -> I1 -> A
# |     struct cwg242::D -> I2 -> A
# | error: diagnostic messages of 'error' severity not fully matched: 
# |   'expected-error' at line 711 in C:\_work\llvm-project\llvm-project\clang\test\CXX\drs\cwg2xx.cpp: ambiguous cast from base 'cwg242::A' to derived 'cwg242::D'
# |     does not fully match diagnostic at line 710: ambiguous cast from base 'cwg242::A' to derived 'cwg242::D':
# |     A -> I1 -> struct cwg242::D
# |     A -> I2 -> struct cwg242::D
# | 7 errors generated.
# `-----------------------------
# 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/201441


More information about the cfe-commits mailing list