[libcxx-commits] [libcxx] [libc++] mark `std::expected` as	`nodiscard` (PR #130820)
    Yihe Li via libcxx-commits 
    libcxx-commits at lists.llvm.org
       
    Thu Mar 20 11:46:18 PDT 2025
    
    
  
Mick235711 wrote:
If we are doing this, should we add a reason for why `std::expected` is marked as `[[nodiscard]]`? I believe it would be more helpful if a reason is supplied in the warning message for users who encountered a warning.
Although libc++ doesn't seem to use `[[nodiscard("reason")]]` at all currently. Is there a policy for that internally?
https://github.com/llvm/llvm-project/pull/130820
    
    
More information about the libcxx-commits
mailing list