summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/cpp0x/constexpr-empty9.C
blob: 26b4863448989e34e7263f2bbdaf691ab8500a1d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
// PR c++/65896
// { dg-do compile { target c++11 } }

struct base {};

struct derived :  base {
	constexpr derived():
		base{},
		m_value(0) {
	}
	int m_value;
};

constexpr int by_ref(derived && value) {
	return value.m_value;
}

constexpr int value = by_ref(derived{});