public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/51480] New: non-const default argument gets rejected
@ 2011-12-09  8:41 thomas@maier-komor.de
  2011-12-09  9:36 ` [Bug c++/51480] " redi at gcc dot gnu.org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: thomas@maier-komor.de @ 2011-12-09  8:41 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51480

             Bug #: 51480
           Summary: non-const default argument gets rejected
    Classification: Unclassified
           Product: gcc
           Version: 4.5.3
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: thomas@maier-komor.de


non-const default arguments get rejected with following error message:
error: default argument for 'A& a' has type 'A'

Here is an example, where function rejected causes an error, while function
accepted is accepted.

struct A
{
};

void accepted(const A &a = A())
{
}

void rejected(A &a = A())
{
}


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2011-12-09 10:03 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-12-09  8:41 [Bug c++/51480] New: non-const default argument gets rejected thomas@maier-komor.de
2011-12-09  9:36 ` [Bug c++/51480] " redi at gcc dot gnu.org
2011-12-09  9:52 ` thomas@maier-komor.de
2011-12-09 10:03 ` redi at gcc dot gnu.org
2011-12-09 11:23 ` redi at gcc dot gnu.org

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).