courbet marked an inline comment as done.
courbet added inline comments.

================
Comment at: test/PCH/cxx-static_assert.cpp:17
 
-// expected-error@12 {{static_assert failed "N is not 2!"}}
+// expected-error@12 {{static_assert failed due to requirement '1 == 2' "N is 
not 2!"}}
 T<1> t1; // expected-note {{in instantiation of template class 'T<1>' 
requested here}}
----------------
aaron.ballman wrote:
> I'm not certain how I feel about now printing the failure condition when 
> there's an explicit message provided. From what I understand, a fair amount 
> of code in the wild does `static_assert(some_condition, "some_condition")` 
> because of older language modes where the message was not optional. I worry 
> we're going to start seeing a lot of diagnostics like: `static_assert failed 
> due to requirement '1 == 2' "N == 2"`, which seems a bit low-quality. See 
> `DFAPacketizer::DFAPacketizer()` in LLVM as an example of something similar.
> 
> Given that the user entered a message, do we still want to show the 
> requirement? Do we feel the same way if the requirement is fairly large?
The issue is that `"N == 2"` is a useless error message. Actually, since the  
error message has to be a string literal, there is no way for the user to print 
a debuggable output. So I really think we should print the failed condition.


Repository:
  rC Clang

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

https://reviews.llvm.org/D55270



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

Reply via email to