public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
From: mueller@kde.org
To: gcc-gnats@gcc.gnu.org
Subject: c++/9537: [3.4 regression] [New parser] problem handling const return types
Date: Sat, 01 Feb 2003 21:06:00 -0000	[thread overview]
Message-ID: <20030201210520.55EBE4DDEBB@bembel.homeip.net> (raw)


>Number:         9537
>Category:       c++
>Synopsis:       [3.4 regression] [New parser] problem handling const return types
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          rejects-legal
>Submitter-Id:   net
>Arrival-Date:   Sat Feb 01 21:06:00 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator:     Dirk Mueller
>Release:        3.4 20030201 (experimental)
>Organization:
>Environment:
System: Linux matrix 2.4.19-4GB #6 Thu Jan 30 02:58:14 CET 2003 i686 unknown
Architecture: i686

	
host: i686-pc-linux-gnu
build: i686-pc-linux-gnu
target: i686-pc-linux-gnu
configured with: ../configure --prefix=/opt/gcc --enable-c99 --enable-long-long --enable-shared --enable-threads --enable-languages=c,c++
>Description:

This testcase: 

=== Cut ===
class String
{
public:
    String();
    String( char *str );
    operator char *();
};

const String operator+( String s1, String ) // <- remove const here
{
  return s1;
}

String valGlue(const String before)
{
    String ret;
    return false ? ret : before + before;
}
=== Cut ===


does no longer compile:

$ g++ -c foo.cc
foo.cpp: In function `String valGlue(String)':
foo.cpp:18: error: non-lvalue in unary `&'

It does compile when removing the const in the marked place, so I'm not sure if this is a bug in the parser or by design. 


http://gcc.gnu.org/ml/gcc/2003-01/msg01643.html

seems to describe a similiar, however not identical problem. 



>How-To-Repeat:
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted:


             reply	other threads:[~2003-02-01 21:06 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-02-01 21:06 mueller [this message]
2003-02-02 22:32 bangerth
2003-02-03  1:36 Dirk Mueller
2003-02-03 16:26 Wolfgang Bangerth
2003-05-05 21:11 jason

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20030201210520.55EBE4DDEBB@bembel.homeip.net \
    --to=mueller@kde.org \
    --cc=gcc-gnats@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).