re PR c++/10915 (a not-useful non-avoidable warning: conversion to a reference to the same type will never use a type conversion operator)

testsuite/
        * g++.old-deja/g++.jason/conversion5.C: Adjust option.
        * g++.old-deja/g++.bugs/900215_01.C: Likewise.

cp/
        PR c++/10915
        * decl.c (grok_op_properties): Warn possible confusing conversion
        only if -Wconversion.

From-SVN: r68303
This commit is contained in:
Gabriel Dos Reis 2003-06-21 13:09:05 +00:00 committed by Gabriel Dos Reis
parent 6f705fc773
commit dfbeb0610e
6 changed files with 23 additions and 1 deletions

View File

@ -1,3 +1,9 @@
2003-06-21 Gabriel Dos Reis <gdr@integrable-solutions.net>
PR c++/10915
* decl.c (grok_op_properties): Warn possible confusing conversion
only if -Wconversion.
2003-06-20 Mark Mitchell <mark@codesourcery.com>
PR c++/10749

View File

@ -12371,7 +12371,7 @@ grok_op_properties (tree decl, int friendp)
&& DERIVED_FROM_P (t, current_class_type))
what = "a base class";
if (what)
if (what && warn_conversion)
warning ("conversion to %s%s will never use a type conversion operator",
ref ? "a reference to " : "", what);
}

View File

@ -1,3 +1,8 @@
2003-06-21 Gabriel Dos Reis <gdr@integrable-solutions.net>
* g++.old-deja/g++.jason/conversion5.C: Adjust option.
* g++.old-deja/g++.bugs/900215_01.C: Likewise.
2003-06-20 Mark Mitchell <mark@codesourcery.com>
PR c++/10888

View File

@ -0,0 +1,8 @@
// Copyright (C) 2003 Free Software Foundation
// Contributed by Gabriel Dos Reis <gdr@integrable-solutions.net>
// { dg-options "-Wno-conversion" }
struct A {
operator A&();
};

View File

@ -20,6 +20,8 @@
// 8/3/2000 (nathan): The std allows you to define such an op, but
// it will never be called. [class.conv.fct]. Make it an unconditional warning.
// { dg-options "-Wconversion" }
struct struct0 {
operator void (); // { dg-warning "" } operator void

View File

@ -1,4 +1,5 @@
// { dg-do assemble }
// { dg-options "-Wconversion" }
struct A { };
struct B: public A {
A a;