comparison gcc/testsuite/g++.dg/template/conv6.C @ 111:04ced10e8804

gcc 7
author kono
date Fri, 27 Oct 2017 22:46:09 +0900
parents
children
comparison
equal deleted inserted replaced
68:561a7518be6b 111:04ced10e8804
1 // { dg-do compile }
2
3 // Copyright (C) 2003 Free Software Foundation, Inc.
4 // Contributed by Nathan Sidwell 21 Mar 2003 <nathan@codesourcery.com>
5
6 // PR 9898, DR 322. Conversion to reference type.
7
8 template <typename> struct Ref {};
9 template <typename> struct Val {};
10
11 struct Wrapper
12 {
13 template <typename U> operator Ref<U> & ();
14 template <typename U> operator Val<U> ();
15 };
16
17 void Foo (Wrapper l)
18 {
19 static_cast <Ref<int> &> (l);
20 static_cast <Ref<int> const &> (l);
21 static_cast <Ref<int> > (l);
22 static_cast <Val<int> const &> (l);
23 static_cast <Val<int> > (l);
24 }