summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaCXX/static-assert-cxx17.cpp
Commit message (Collapse)AuthorAgeFilesLines
* [Sema][NFC] Add test for static_assert diagnistics with constexpr template ↵Clement Courbet2018-12-201-0/+7
| | | | | | functions. llvm-svn: 349755
* [Sema] Better static assert diagnostics for expressions involving ↵Clement Courbet2018-12-201-0/+41
| | | | | | | | | | | | | | | | | | temporaries/casts/.... Summary: Handles expressions such as: - `std::is_const<T>()` - `std::is_const<T>()()`; - `std::is_same(decltype(U()), V>::value`; Reviewers: aaron.ballman, Quuxplusone Subscribers: cfe-commits, llvm-commits Differential Revision: https://reviews.llvm.org/D55552 llvm-svn: 349729
* Reland r348741 "[Sema] Further improvements to to static_assert diagnostics."Clement Courbet2018-12-111-0/+9
| | | | | | Fix a dangling reference to temporary, never return nullptr. llvm-svn: 348834
* Revert r348741 "[Sema] Further improvements to to static_assert diagnostics."Clement Courbet2018-12-101-9/+0
| | | | | | Seems to break build bots. llvm-svn: 348742
* [Sema] Further improvements to to static_assert diagnostics.Clement Courbet2018-12-101-0/+9
| | | | | | | | | | | | | | Summary: We're now handling cases like `static_assert(!expr)` and static_assert(!(expr))`. Reviewers: aaron.ballman, Quuxplusone Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D55270 llvm-svn: 348741
* [WIP][Sema] Improve static_assert diagnostics for type traits.Clement Courbet2018-12-041-0/+47
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
OpenPOWER on IntegriCloud