[C++ Patch / RFC] PR 48420

Paolo Carlini paolo.carlini@oracle.com
Thu Nov 3 03:29:00 GMT 2011


Hi,

this issue seems pretty easy to deal with: submitter complains that we 
warn for

void foo(int* p);

void bar() {
   foo(false);
}

and we do *not* for:

void foo(int* p);

void bar() {
   const bool kDebugMode = false;
   foo(kDebugMode);
}

thus I tried using decl_constant_var_p / integral_constant_value and it 
worked fine, as expected. However - I may be wrong - but I'm not seeing 
*much* of this kind of idea around for diagnostic purposes, I'm afraid 
I'm missing something. It is actually Ok?

Anyway, testsuite passes on x86_64-linux (bootstrap pending, important 
because the W is on by default!)

Thanks,
Paolo.

//////////////////
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: CL_48420
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20111103/02c2ff3a/attachment.ksh>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: patch_48420
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20111103/02c2ff3a/attachment-0001.ksh>


More information about the Gcc-patches mailing list