[PATCH] D21673: [libcxx] guard throw with exception enabling check

Zhao, Weiming via cfe-commits cfe-commits at lists.llvm.org
Fri Jun 24 09:43:50 PDT 2016


It's a good idea. Currently, there are about 600+  "throws" being 
guarded by _LIBCPP_NO_EXCEPTIONS macro.

How about let's merge the patch now and I can do the conversion of 
existing code to the wrapper in background?

Weiming

On 6/24/2016 1:25 AM, Noel Grandin wrote:
> grandinj added a subscriber: grandinj.
>
> ================
> Comment at: include/experimental/optional:524
> @@ -521,1 +523,3 @@
> +            assert(!"bad optional access");
> +#endif
>           return this->__val_;
> ----------------
> If this kind of code is going to show up in lots of places, then maybe wrap it up in a macro:
>
>     _LIBCPP_THROW_OR_ASSERT(bad_optional_access(), "bad optional access")
>
> ?
>
> With some extra preprocessor magic, and if LLVM didn't care about the string in the assert, could even leave out the second parameter
>
>
> http://reviews.llvm.org/D21673
>
>
>

-- 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation



More information about the cfe-commits mailing list