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

Reply via email to