[libcxx-commits] [PATCH] D103947: [libcxx] Fix using the vcruntime ABI with _HAS_EXCEPTIONS=0 defined

Nikolas Klauser via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Wed Apr 20 16:30:55 PDT 2022


philnik added inline comments.


================
Comment at: libcxx/include/exception:141
+protected:
+    const char* _Ptr; 
+};
----------------
phosek wrote:
> paulkirth wrote:
> > phosek wrote:
> > > I wonder if we should annotate this with `[[maybe_unused]]` to avoid a compiler warning.
> > That may be a good idea. Grep didn't reveal a macro that I saw, but I may have missed it. I do see that this file has a `_LIBCPP_DIAGNOISTIC_IGNORED(-Wunused-private-field)` maybe that is the correct approach here w/ a change to the warning?
> > 
> > 
> I'd prefer defining a new macro, e.g. `_LIBCPP_MAYBE_UNUSED`, akin to `_NOEXCEPT` which would expand to `[[maybe_unused]]` (or `__attribute__((unused))` if `[[maybe_unused]]` is unavailable).
I'd rather avoid adding more macros. This shouldn't ever generate a warning, since the variable is `protected` and not `private`. Otherwise I would consider this a compiler bug.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D103947/new/

https://reviews.llvm.org/D103947



More information about the libcxx-commits mailing list