Bug 44725 - -pedantic should report gcc extension
Summary: -pedantic should report gcc extension
Status: RESOLVED INVALID
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 4.6.0
: P3 minor
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-06-30 15:24 UTC by Mathieu Malaterre
Modified: 2011-09-25 16:16 UTC (History)
0 users

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mathieu Malaterre 2010-06-30 15:24:22 UTC
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 !
Comment 1 Paolo Carlini 2011-09-25 16:16:18 UTC
That isn't an <extension> but an ISO Core DR, whose resolution is implemented (apparently). In such cases (hundreds) we definitely don't warn. By the way, Intel and Comeau behave exactly like GCC.