This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/48490] New: "delete" with template convertion operator does overload resolution for class operands, but shouldn't.


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48490

           Summary: "delete" with template convertion operator does
                    overload resolution for class operands, but shouldn't.
           Product: gcc
           Version: 4.4.4
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: flast@flast.jp


GCC accepts following code. But it should be reject.

---- testcase.C ----
struct S
{
    template < typename T >
    operator T *() { return 0; }
};

int main()
{
    S s;
    delete s;
}
----

All of following versions accept it.
Ubuntu/Linaro 4.4.4-14ubuntu5
4.5.2
4.5.3 20110217
4.6.0
4.6.1 20110310
4.7.0 20110405


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]