blob: e38b968e7749389cc8b80d274a82232e3a14fac0 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
// PR c++/85060
// { dg-do compile { target c++14 } }
struct CA {
constexpr int foo() const { return 42; }
};
template <class T>
struct CB : CA { };
template <class T>
struct CC : CB<T> {
constexpr int bar() const {
const int m = CA::foo();
return m;
}
constexpr int baz() const {
const T m = CA::foo();
return m;
}
};
constexpr CC<double> c;
static_assert( c.bar() == 42, "" );
|