[PATCH] D55270: [Sema] Further improvements to to static_assert diagnostics.
Arthur O'Dwyer via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Dec 11 14:42:24 PST 2018
Quuxplusone added a comment.
@courbet: On the cpplang Slack, Peter Feichtinger mentioned that defaulted template arguments should perhaps be treated differently. Is there any way to suppress the `, std::allocator<int>` part of this diagnostic? https://godbolt.org/z/TM0UHc
Before your patches:
<source>:11:5: error: static_assert failed due to requirement 'std::is_integral_v<typename S::t>'
static_assert(std::is_integral_v<typename T::t>);
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
After your patches:
<source>:11:5: error: static_assert failed due to requirement 'std::is_integral_v<std::vector<int, std::allocator<int> > >'
static_assert(std::is_integral_v<typename T::t>);
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
I don't think the new behavior is //worse//; but I don't think it's optimal, either.
I think Clang already has a feature to suppress printing these parameters; you would just have to figure out where it is and try to hook it into your thing. (And if you do, I'm going to ask for a test case where `T::t` is `std::pmr::vector<int>`!)
Repository:
rL LLVM
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D55270/new/
https://reviews.llvm.org/D55270
More information about the llvm-commits
mailing list