This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/51480] New: non-const default argument gets rejected
- From: "thomas at maier-komor dot de" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 09 Dec 2011 08:19:05 +0000
- Subject: [Bug c++/51480] New: non-const default argument gets rejected
- Auto-submitted: auto-generated
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())
{
}