lmi
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lmi] Stifling "unused" warnings


From: Greg Chicares
Subject: Re: [lmi] Stifling "unused" warnings
Date: Tue, 26 Oct 2021 23:17:46 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0

On 10/26/21 9:26 PM, Vadim Zeitlin wrote:
> On Tue, 26 Oct 2021 21:11:39 +0000 Greg Chicares <gchicares@sbcglobal.net> 
> wrote:
> 
> GC> I can't remember why I wrote both these function templates:
> GC>   stifle_warning_for_unused_variable()
> GC>   stifle_warning_for_unused_value()
> GC> when it seems that either should suffice. I've searched the
> GC> mailing list and the commit history, but found no rationale.
> 
>  I'm almost certain that we discussed this before, but you must have found
> these discussions in the list archives. AFAIR I didn't see any reason to
> have the 2 basically identical functions neither, but I wanted one of them
> to take a non-const reference to allow using it with uninitialized
> variables too, without triggering -Wuninitialized-const-reference from
> clang.

I would like to add a test case for '-Wuninitialized-const-reference'
to 'miscellany_test.cpp'. But what should that test be? Something like:

  int foobar(const int& i) {}
  int i;
  foobar(i);

which I copied from
  https://tobias.hieta.se/llvm11-release
?


reply via email to

[Prev in Thread] Current Thread [Next in Thread]