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 10915] New: a not-useful non-avoidable warning: conversion to a reference to the same type will never use a type conversion operator


PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

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

           Summary: a not-useful non-avoidable warning:  conversion to a
                    reference to the same type will never use a type
                    conversion operator
           Product: gcc
           Version: 3.2.2
            Status: UNCONFIRMED
          Severity: minor
          Priority: P2
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: serge.bogdanov@intel.com
                CC: gcc-bugs@gcc.gnu.org

Warning: "conversion to a reference to the same type will never use a type
conversion operator" is generated in decl.c:12578.

It would be nice to be able to turn the warning off or get rid of it, because it
does not provide any useful info.

This warning is produced in the following example (that shows a possible usage
for the conversion operator):

#include <iostream>
struct X;
struct A {
    virtual operator X&();
};
struct X : public A {
    operator X&() {
	return *this;
    }
};
A::operator X&() {
    static X x;
    std::cerr << "Error" << std::endl;
    return x;
}



------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


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