aaron.ballman added a comment.

In D130894#3702233 <https://reviews.llvm.org/D130894#3702233>, @tbaeder wrote:

> I don't know much about fixit hints, would they be appropriate to display it 
> below the line itself, e.g.
>
>   test.cpp:24:17: note: expression evaluates to
>   static_assert(c != c);
>               '0' != '0'
>                 ~~^~~~

Nope, that would be a bad thing -- Clang has the ability to automatically apply 
fix-it hints to the source, so this would modify the static assertion to 
continue to be false which isn't much of a fix.

> Or would it be even better to just inline the evaluated expression into the 
> `static_assert` ala
>
>   test.cpp:24:17: note: expression evaluates to
>   static_assert('0' != '0');
>                   ~~^~~~

Making sure I'm following along, you mean that we'd display the error for the 
static assertion, and then the note would show `static_assert(<actual values in 
the reconstituted expression>)`?

I think this might work for very simple static asserts, but what about more 
complicated ones like `static_assert(foo() && (bar() == 12 || baz()) && 'a' != 
quux(4000));`?


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

https://reviews.llvm.org/D130894

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

Reply via email to