Mercurial > hg > CbC > CbC_gcc
annotate gcc/testsuite/g++.dg/cpp1y/auto-fn50.C @ 131:84e7813d76e9
gcc-8.2
author | mir3636 |
---|---|
date | Thu, 25 Oct 2018 07:37:49 +0900 |
parents | |
children |
rev | line source |
---|---|
131 | 1 // PR c++/84906 |
2 // { dg-do compile { target c++14 } } | |
3 | |
4 extern "C" int puts(const char*); | |
5 | |
6 struct aa { | |
7 operator auto() { | |
8 puts("auto"); | |
9 return false; | |
10 } | |
11 explicit operator bool() { | |
12 puts("bool"); | |
13 return true; | |
14 } | |
15 }; | |
16 | |
17 int main() { | |
18 aa x; | |
19 if (x) // { dg-error "ambiguous" } | |
20 puts("here"); | |
21 else | |
22 puts("there"); | |
23 } |