[Bug c++/51480] New: non-const default argument gets rejected
thomas@maier-komor.de
gcc-bugzilla@gcc.gnu.org
Fri Dec 9 08:41:00 GMT 2011
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())
{
}
More information about the Gcc-bugs
mailing list