comparison gcc/testsuite/g++.dg/cpp2a/explicit16.C @ 152:2b5abeee2509

update gcc11
author anatofuz
date Mon, 25 May 2020 07:50:57 +0900
parents
children
comparison
equal deleted inserted replaced
145:1830386684a0 152:2b5abeee2509
1 // PR c++/95066 - explicit malfunction with dependent expression.
2 // { dg-do compile { target c++2a } }
3
4 template <typename T>
5 struct Foo {
6 template <typename U>
7 explicit(static_cast<U>(true)) operator Foo<U>();
8 };
9
10 template <typename T>
11 template <typename U>
12 Foo<T>::operator Foo<U>() {
13 return {};
14 }
15
16 int
17 main ()
18 {
19 Foo<float> a;
20 Foo<int> b = a; // { dg-error "conversion" }
21 }