On 10/10/2011 12:41 AM, Jason Merrill wrote:
On 10/09/2011 11:40 PM, Jason Merrill wrote:
Hmm, I guess it's unlikely that a conversion is going to hit both that
warning and another one. OK.
Wait...how about changing conversion_null_warnings to stop looking
through references? Does that break anything?
If I just do this (I hope it's what you had in mind):
static void
conversion_null_warnings (tree totype, tree expr, tree fn, int argnum)
{
- tree t = non_reference (totype);
+ tree t = totype; /*non_reference (totype); */
I see this failure, for sure: cpp0x/variadic111.C, that is:
// PR c++/48424
// { dg-options -std=c++0x }
template<typename... Args1>
struct S
{
template<typename... Args2>
void f(Args1... args1, Args2&&... args2)
{
}
};
int main()
{
S<int, double> s;
s.f(1,2.0,false,'a');
}
triggers:
variadic111.C:16:22: warning: converting ‘false’ to pointer type for
argument 3 of ‘void S<Args1>::f(Args1 ..., Args2&& ...) [with Args2 =
{bool, char}; Args1 = {int, double}]’ [-Wconversion-null]
Also, tree-ssa/copyprop.C, for example.
Paolo.