Quuxplusone added a comment.

> The warning is fundamentally about dataflow, but this doesn't apply to 
> unevaluated expressions. There are plenty of cases where a user might want to 
> ask if assignment is well formed on noexcept using only one variable. For 
> example:
> 
>   template <class T> void foo(T& value) noexcept(noexcept(value = value)) { 
> /* perform an assignment somewhere */ }

My impression is that this case will not trigger the warning because the 
variable `value` is dependently typed.
I agree there should be a regression test for this exact case just to make sure 
of that.

@EricWF, is it important IYO that this warning not trigger in unevaluated 
contexts even for non-dependently-typed variables?
This is the case that seems to be coming up in practice in libc++ tests, but is 
hard to reason about because it's "only" deliberately contrived test code.

  auto foo(std::exception& value)
      noexcept(noexcept(value = value)) // ok to diagnose?
      -> decltype(value = value)  // ok to diagnose?
  {
      static_assert(noexcept(value = value));  // ok to diagnose?
  }


Repository:
  rC Clang

https://reviews.llvm.org/D44883



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to