Debian Codegraph @

gcc/testsuite/g++.dg/cpp0x/constexpr-ctor22.C

raw
1 // PR c++/116722
2 // We're now accepting this in spite of the virtual base class. This is OK
3 // according to [dcl.constexpr] 3: "Except for instantiated constexpr functions
4 // non-templated constexpr functions shall be constexpr-suitable".
5 // { dg-do compile { target c++11 } }
6
7 class base {};
8 class derived : virtual public base {
9 public:
10 template<typename Arg>
11 constexpr derived(Arg) {}
12 };
13 int main() {
14 derived obj(1.);
15 }