diff options
author | Mark Mitchell <mark@codesourcery.com> | 2001-11-29 20:19:41 +0000 |
---|---|---|
committer | Mark Mitchell <mmitchel@gcc.gnu.org> | 2001-11-29 20:19:41 +0000 |
commit | b67db52985b8ed3a7b4a32f7948b50e6bff6f6b1 (patch) | |
tree | dc2415b0e8f3782ef58db5b79075527d91d8a441 /gcc/testsuite | |
parent | 004249997b5d72d28958a0220b60e5be8cf6bf18 (diff) | |
download | gcc-b67db52985b8ed3a7b4a32f7948b50e6bff6f6b1.zip gcc-b67db52985b8ed3a7b4a32f7948b50e6bff6f6b1.tar.gz gcc-b67db52985b8ed3a7b4a32f7948b50e6bff6f6b1.tar.bz2 |
re PR c++/3471 (gcc 3.01 reports error about a private copy constructor that shouldn't get called.)
PR c++/3471
* call.c (convert_like_real): Do not build additional temporaries
for rvalues of class type.
From-SVN: r47451
Diffstat (limited to 'gcc/testsuite')
-rw-r--r-- | gcc/testsuite/g++.old-deja/g++.law/cvt7.C | 8 | ||||
-rw-r--r-- | gcc/testsuite/g++.old-deja/g++.mike/p5469.C | 4 | ||||
-rw-r--r-- | gcc/testsuite/g++.old-deja/g++.other/copy3.C | 23 |
3 files changed, 29 insertions, 6 deletions
diff --git a/gcc/testsuite/g++.old-deja/g++.law/cvt7.C b/gcc/testsuite/g++.old-deja/g++.law/cvt7.C index 7529bc2..0ea1d55 100644 --- a/gcc/testsuite/g++.old-deja/g++.law/cvt7.C +++ b/gcc/testsuite/g++.old-deja/g++.law/cvt7.C @@ -10,8 +10,8 @@ class A { public: - A(int j) { i = j; } // ERROR - candidate - A(A& a) { i = a.i; } // ERROR - candidate + A(int j) { i = j; } + A(A& a) { i = a.i; } operator int() { return i; } void assign(int v) { i = v; } @@ -37,10 +37,10 @@ B::run() // Replacing above with "switch (int(in))" removes the error. { case 0: - out = 1; // ERROR - no usable copy ctor + out = 1; break; default: - out = 0; // ERROR - no usable copy ctor + out = 0; break; } } diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p5469.C b/gcc/testsuite/g++.old-deja/g++.mike/p5469.C index 9e5250e..9af2010 100644 --- a/gcc/testsuite/g++.old-deja/g++.mike/p5469.C +++ b/gcc/testsuite/g++.old-deja/g++.mike/p5469.C @@ -4,7 +4,7 @@ int count; class A { A(); - A(const A&); // ERROR - referenced below + A(const A&); public: A(int) { ++count; } ~A() { --count; } @@ -14,7 +14,7 @@ public: int main() { { A a (1); - if (a == 2 && a == 1) // ERROR - private copy ctor + if (a == 2 && a == 1) ; } return count; diff --git a/gcc/testsuite/g++.old-deja/g++.other/copy3.C b/gcc/testsuite/g++.old-deja/g++.other/copy3.C new file mode 100644 index 0000000..aa2c905 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.other/copy3.C @@ -0,0 +1,23 @@ +// Build don't run: +// Origin: ericp@mit.edu + +class bar { +}; + +class foo { + foo (const foo &f); + +public: + + foo (bar x) {} + foo () {} + + void test (const foo &f) {} +}; + +int main (void) { + foo f; + bar b; + + f.test (b); +} |