OSDN Git Service

cp/ChangeLog
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / g++.old-deja / g++.other / refinit2.C
1 // { dg-do assemble  }
2 // 
3 // Copyright (C) 2000, 2002 Free Software Foundation, Inc.
4 // Contributed by Nathan Sidwell 10 Aug 2000 <nathan@codesourcery.com>
5
6 // bug 381. We gave slightly different diagnostics, when binding an rvalue to
7 // a non-const reference, depending on the precise type to the rvalue.
8
9 namespace A { 
10 template <class T> void f(T) {}
11 }
12 void (* &h)(int) = A::f<int>;       // { dg-error "" } rvalue to non-const
13 void (*const volatile &i)(int) = A::f<int>;  // { dg-error "" } rvalue to volatile
14 void (*const &j)(int) = A::f<int>;
15
16 int &k = 1;                         // { dg-error "" } rvalue to non-const
17 int &const volatile l = 1;          // { dg-error "" } rvalue to volatile
18 int const &m = 1;