I like the idea of tagging diagnose_ifs with tags, though I wonder how this
could be made applicable to code outside of libcxx. Specifically, if I
import some big library that uses diagnose_if, then I'd still need to use
`-Wno-user-defined-warnings` if said lib had a single diagnose_if that I
My dream, and something I would like to work towards is supporting
something like this:
> [[clang::libcxx_diagnose_if(cond, "message", "warning", /* warning-id*/
"non-const-functor")]]
>
> -Wno-libcxx-warnings=non-const-functor
This way libc++ warnings get treated differently from all other
The only plan that we have at the moment is basically for a
-Wno-user-defined-warnings-in-system-headers type of flag. I agree that it
would be nice if we could be more granular than this, so I'll think about
what we can do.
On Mon, Jan 23, 2017 at 8:36 AM, Nico Weber wrote:
This happens to fire in practice in protobuf. It's probably a true positive
and it's cool that this warning found it, but it means we have to disable
Wuser-defined-warnings for a bit -- which then disables all of these
user-defined warnings. Right now there aren't any others, but it feels like
Author: ericwf
Date: Fri Jan 13 16:02:08 2017
New Revision: 291961
URL: http://llvm.org/viewvc/llvm-project?rev=291961=rev
Log:
Add _LIBCPP_DIAGNOSE_WARNING and _LIBCPP_DIAGNOSE_ERROR macros.
Clang recently added a `diagnose_if(cond, msg, type)` attribute
which can be used to generate