Summary: | [3.2 regression] unhelpful error message for binding temp to reference | ||
---|---|---|---|
Product: | gcc | Reporter: | adelroy |
Component: | c++ | Assignee: | Not yet assigned to anyone <unassigned> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | gcc-bugs, jbuck, mmitchel |
Priority: | P3 | ||
Version: | 3.2 | ||
Target Milestone: | --- | ||
Host: | Target: | ||
Build: | Known to work: | ||
Known to fail: | Last reconfirmed: | ||
Attachments: | txt.ii.bz2 |
Description
adelroy
2002-11-25 07:16:03 UTC
Fix: Fixed in GCC 3.3, 3.4 with: http://gcc.gnu.org/ml/gcc-patches/2003-03/msg00974.html State-Changed-From-To: open->analyzed State-Changed-Why: Confirmed. The reason, of course, is that you try to bind the temporary to a non-const reference. gcc2.95 actually tells you this: ---------------------------- tmp/g> c++ -c x.cc x.cc: In function `int main()': x.cc:28: initialization of non-const reference type `class txt &' x.cc:28: from rvalue of type `txt' x.cc:13: in passing argument 1 of `operator <<<char[21]>(txt &, const char (&)[21])' -------------------------------- The messages we get from 3.2.1 and 3.3 are incomprehensible compared to that, which I rate as a regression, so I put this into "high" state and leave it to others whether this merits fixing. From: mmitchel@gcc.gnu.org To: gcc-gnats@gcc.gnu.org Cc: Subject: c++/8700 Date: 11 Mar 2003 15:43:15 -0000 CVSROOT: /cvs/gcc Module name: gcc Changes by: mmitchel@gcc.gnu.org 2003-03-11 15:43:15 Modified files: gcc/cp : ChangeLog call.c cp-tree.h decl2.c friend.c Log message: PR c++/8700 * call.c (convert_class_to_reference): Adjust usage of splice_viable. (any_viable): Remove. (splice_viable): Combine with any_viable. (print_z_candidates): Avoid printing duplicates. (build_user_type_conversion_1): Adjust usage of splice_viable. (build_new_function_call): Likewise. (build_operator_new_call): Likewise. (build_object_call): Likewise. (build_conditional_expr): Likewise. (build_new_op): Likewise. (build_new_method_call): Likewise. (joust): Remove spurious comment. * cp-tree.h (DECL_FRIENDLIST): Correct documentation. * decl2.c (arg_assoc_class): Simplify. * friend.c (add_friend): Likewise. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&r1=1.3261&r2=1.3262 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/call.c.diff?cvsroot=gcc&r1=1.366&r2=1.367 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/cp-tree.h.diff?cvsroot=gcc&r1=1.823&r2=1.824 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/decl2.c.diff?cvsroot=gcc&r1=1.603&r2=1.604 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/friend.c.diff?cvsroot=gcc&r1=1.81&r2=1.82 From: mmitchel@gcc.gnu.org To: gcc-gnats@gcc.gnu.org Cc: Subject: c++/8700 Date: 11 Mar 2003 15:56:52 -0000 CVSROOT: /cvs/gcc Module name: gcc Branch: gcc-3_3-branch Changes by: mmitchel@gcc.gnu.org 2003-03-11 15:56:52 Modified files: gcc/cp : ChangeLog call.c Log message: PR c++/8700 * call.c (print_z_candidates): Avoid printing duplicates. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=1.3076.2.74&r2=1.3076.2.75 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/call.c.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=1.341.2.11&r2=1.341.2.12 State-Changed-From-To: analyzed->closed State-Changed-Why: Fixed for 3.3 and in trunk, and 3.2 branch is now closed. |