gcc/testsuite/g++.dg/cpp23/explicit-obj-diagnostics4.C
raw| 1 | // P0847R7 |
| 2 | // { dg-do compile { target c++23 } } |
| 3 | |
| 4 | // location diagnostic text when an error is emitted from an xobj member function |
| 5 | // this does not test for specific ill-formed code, just the additional diagnostic message |
| 6 | |
| 7 | // { dg-message "In explicit object member function" "" { target *-*-* } 0 } |
| 8 | |
| 9 | struct S { |
| 10 | void f(this S s) { |
| 11 | // The specific diagnosis issued here does not matter |
| 12 | // we just need to force an error to be emitted |
| 13 | +s; // { dg-error "" } |
| 14 | } |
| 15 | }; |
| 16 |