This is the mail archive of the gcc-patches@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]

[C++ Patch / RFC] PR 48420


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.

//////////////////

Attachment: CL_48420
Description: Text document

Attachment: patch_48420
Description: Text document


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