This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/44725] New: -pedantic should report gcc extension
- From: "mathieu dot malaterre at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 30 Jun 2010 15:24:22 -0000
- Subject: [Bug c++/44725] New: -pedantic should report gcc extension
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
in the following example, gcc should report it is using a C++0x extension:
struct ValueInt
{
ValueInt(int v = 0) : ValueLength(v) {}
operator int () const { return ValueLength; }
private:
int ValueLength;
};
int main(int, char *[])
{
int *a = new int[ ValueInt(10) ];
return 0;
}
According to the 98 standard:
implicitly calling the conversion function operator int() is a g++ and C++0x
extension (see
http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#299) that is not
in the current C++ standard.
Thanks !
--
Summary: -pedantic should report gcc extension
Product: gcc
Version: 4.6.0
Status: UNCONFIRMED
Severity: minor
Priority: P3
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: mathieu dot malaterre at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44725