mclow.lists added inline comments.
================
Comment at: test/libcxx/diagnostics/force_nodiscard.fail.cpp:22
+
+_LIBCPP_NODISCARD_AFTER_CXX17 int foo() { return 6; }
+
----------------
lebedev.ri wrote:
> mclow.lists wrote:
> > Shouldn't this be just `_LIBCPP_NODISCARD` ?
> >
> I don't think so?
> I thought we are intentionally testing the same macro that libc++ is using
> internally.
Ok, I see what you're saying.
This test is testing if a function marked `_LIBCPP_NODISCARD_AFTER_CXX17` gives
an error if `_LIBCPP_FORCE_NODISCARD` is defined.
But then you need another test, just like this, with `_LIBCPP_NODISCARD int
foo() { return 6; }` to make sure that that gives an error as well. (and a
passing test, that shows that if you don't opt-in, you get no error)
Repository:
rCXX libc++
https://reviews.llvm.org/D45179
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits