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:
parent
6f705fc773
commit
dfbeb0610e
@ -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
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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
|
||||
|
8
gcc/testsuite/g++.dg/warn/conversion-function-1.C
Normal file
8
gcc/testsuite/g++.dg/warn/conversion-function-1.C
Normal 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&();
|
||||
};
|
||||
|
@ -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
|
||||
|
@ -1,4 +1,5 @@
|
||||
// { dg-do assemble }
|
||||
// { dg-options "-Wconversion" }
|
||||
struct A { };
|
||||
struct B: public A {
|
||||
A a;
|
||||
|
Loading…
Reference in New Issue
Block a user