Mercurial > hg > CbC > CbC_gcc
annotate gcc/testsuite/g++.dg/cpp0x/decltype25.C @ 131:84e7813d76e9
gcc-8.2
author | mir3636 |
---|---|
date | Thu, 25 Oct 2018 07:37:49 +0900 |
parents | 04ced10e8804 |
children |
rev | line source |
---|---|
111 | 1 // PR c++/47851 |
2 // { dg-do compile { target c++11 } } | |
3 | |
4 struct Type { | |
5 void display_type(); | |
6 void display_type() const { } | |
7 }; | |
8 | |
9 typedef Type const ConstType; | |
10 | |
11 struct ConvertibleToType { | |
12 operator Type&() { return *reinterpret_cast<Type*>(this); } | |
13 }; | |
14 | |
15 int main () | |
16 { | |
17 // Both lines should call the const variant. | |
18 (true ? ConvertibleToType() : ConstType()).display_type(); | |
19 decltype((true ? ConvertibleToType() : ConstType()))().display_type(); | |
20 } |