[PATCH] D95915: [clang][driver] Only warn once about invalid -stdlib value

Jonas Hahnfeld via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Feb 3 23:49:05 PST 2021


Hahnfeld added a comment.

In D95915#2541132 <https://reviews.llvm.org/D95915#2541132>, @tbaeder wrote:

> That's what I was looking at right now as well, since using `std::call_once()` already means the methods can't be `const` anymore anyway. Might as well just cache the value.

You can make the caching members `mutable`, IIRC that's a common pattern in Clang code.

> It is still slightly ugly with the current code in that subclasses can override them and then the caching is gone.

True, but not really of concern since their implementation is usually a constant value and not emitting warnings.


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

https://reviews.llvm.org/D95915



More information about the cfe-commits mailing list