diff options
author | Clement Courbet <courbet@google.com> | 2018-12-04 07:59:57 +0000 |
---|---|---|
committer | Clement Courbet <courbet@google.com> | 2018-12-04 07:59:57 +0000 |
commit | 9d432e0d1412bfdbea7a0d18295d63c7d30d3952 (patch) | |
tree | 8b0a68beb96ebdbc6efb5bf086a2cd9eac5c9727 /lldb/packages/Python/lldbsuite/test/expression_command/call-function/TestCallUserDefinedFunction.py | |
parent | 6ba64170efd231be0a747186b2a6152efddd0261 (diff) | |
download | bcm5719-llvm-9d432e0d1412bfdbea7a0d18295d63c7d30d3952.tar.gz bcm5719-llvm-9d432e0d1412bfdbea7a0d18295d63c7d30d3952.zip |
[WIP][Sema] Improve static_assert diagnostics for type traits.
Summary:
In our codebase, `static_assert(std::some_type_trait<Ts...>::value, "msg")`
(where `some_type_trait` is an std type_trait and `Ts...` is the
appropriate template parameters) account for 11.2% of the `static_assert`s.
In these cases, the `Ts` are typically not spelled out explicitly, e.g.
`static_assert(std::is_same<SomeT::TypeT, typename SomeDependentT::value_type>::value, "message");`
The diagnostic when the assert fails is typically not very useful, e.g.
`static_assert failed due to requirement 'std::is_same<SomeT::TypeT, typename SomeDependentT::value_type>::value' "message"`
This change makes the diagnostic spell out the types explicitly , e.g.
`static_assert failed due to requirement 'std::is_same<int, float>::value' "message"`
See tests for more examples.
After this is submitted, I intend to handle
`static_assert(!std::some_type_trait<Ts...>::value, "msg")`,
which is another 6.6% of static_asserts.
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D54903
llvm-svn: 348239
Diffstat (limited to 'lldb/packages/Python/lldbsuite/test/expression_command/call-function/TestCallUserDefinedFunction.py')
0 files changed, 0 insertions, 0 deletions