]> gcc.gnu.org Git - gcc.git/blame - gcc/testsuite/g++.dg/cpp0x/decltype25.C
PR c++/92590 - wrong handling of inherited default ctor.
[gcc.git] / gcc / testsuite / g++.dg / cpp0x / decltype25.C
CommitLineData
8d4bcc35 1// PR c++/47851
4b2e63de 2// { dg-do compile { target c++11 } }
8d4bcc35
JM
3
4struct Type {
5 void display_type();
6 void display_type() const { }
7};
8
9typedef Type const ConstType;
10
11struct ConvertibleToType {
12 operator Type&() { return *reinterpret_cast<Type*>(this); }
13};
14
15int main ()
16{
17 // Both lines should call the const variant.
18 (true ? ConvertibleToType() : ConstType()).display_type();
19 decltype((true ? ConvertibleToType() : ConstType()))().display_type();
20}
This page took 6.368288 seconds and 5 git commands to generate.