| 1 |
// { dg-options "-fdiagnostics-show-caret -pedantic-errors" } |
| 2 |
// { dg-do compile { target c++11 } } |
| 3 |
// { dg-skip-if "virtual constexpr" { *-*-* } { "-std=gnu++2a" } { "" } } |
| 4 |
|
| 5 |
struct S |
| 6 |
{ |
| 7 |
virtual constexpr void foo(); // { dg-error "3:member .foo. can be declared both .virtual. and .constexpr." } |
| 8 |
/* { dg-begin-multiline-output "" } |
| 9 |
virtual constexpr void foo(); |
| 10 |
^~~~~~~ ~~~~~~~~~ |
| 11 |
{ dg-end-multiline-output "" } */ |
| 12 |
constexpr virtual void bar(); // { dg-error "13:member .bar. can be declared both .virtual. and .constexpr." } |
| 13 |
/* { dg-begin-multiline-output "" } |
| 14 |
constexpr virtual void bar(); |
| 15 |
~~~~~~~~~ ^~~~~~~ |
| 16 |
{ dg-end-multiline-output "" } */ |
| 17 |
}; |