From 12af1090975f2d40e5658b1bcfaf0b64f9f381d1 Mon Sep 17 00:00:00 2001 From: Nathan Sidwell Date: Mon, 14 Aug 2000 10:18:57 +0000 Subject: [PATCH] * g++.old-deja/g++.other/refinit2.C: New test. From-SVN: r35673 --- gcc/testsuite/ChangeLog | 4 ++++ .../g++.old-deja/g++.other/refinit2.C | 18 ++++++++++++++++++ 2 files changed, 22 insertions(+) create mode 100644 gcc/testsuite/g++.old-deja/g++.other/refinit2.C diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index ebfb0a4607c..96b5fd78c02 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2000-08-14 Nathan Sidwell + + * g++.old-deja/g++.other/refinit2.C: New test. + 2000-08-13 Geoff Keating * lib/c-torture.exp (c-torture): Make diff --git a/gcc/testsuite/g++.old-deja/g++.other/refinit2.C b/gcc/testsuite/g++.old-deja/g++.other/refinit2.C new file mode 100644 index 00000000000..1246e783772 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.other/refinit2.C @@ -0,0 +1,18 @@ +// Build don't link: +// +// Copyright (C) 2000 Free Software Foundation, Inc. +// Contributed by Nathan Sidwell 10 Aug 2000 + +// bug 381. We gave slightly different diagnostics, when binding an rvalue to +// a non-const reference, depending on the precise type to the rvalue. + +namespace A { +template void f(T) {} +}; +void (* &h)(int) = A::f; // ERROR - rvalue to non-const +void (*const volatile &i)(int) = A::f; // ERROR - rvalue to volatile +void (*const &j)(int) = A::f; + +int &k = 1; // ERROR - rvalue to non-const +int &const volatile l = 1; // ERROR - rvalue to volatile +int const &m = 1; -- 2.30.2