-
Notifications
You must be signed in to change notification settings - Fork 15.3k
Closed
Labels
bugzillaIssues migrated from bugzillaIssues migrated from bugzillac++clang:frontendLanguage frontend issues, e.g. anything involving "Sema"Language frontend issues, e.g. anything involving "Sema"rejects-valid
Description
| Bugzilla Link | 43066 |
| Version | trunk |
| OS | All |
| CC | @dwblaikie,@DougGregor,@dobbelaj-snps,@ameisen,@zygoloid,@zoecarver |
Extended Description
The following code fails to compile under Clang with '-std=c++2a' and '-std=c++17':
#include <tuple>
struct foo {
const std::tuple<int> v_;
constexpr foo (int v) : v_(v) {}
bool operator == (int value) const __restrict {
return std::apply([](auto) {return true;}, v_);
}
};
bool test (int v) {
return foo{0} == v;
}If the __restrict is removed from the operator ==, it compiles.
This code successfully compiles under GCC and MSVC:
The core errors appear to be:
tuple:1271:44: error: implicit instantiation of undefined template 'std::tuple_size<__restrict std::tuple<int> >'
inline constexpr size_t tuple_size_v = tuple_size<_Tp>::value;
tuple:1686:44: error: non-type template argument is not a constant expression
using _Indices = make_index_sequence<tuple_size_v<decay_t<_Tuple>>>;
tuple:1687:14: error: no matching function for call to '__apply_impl'
return std::__apply_impl(std::forward<_Fn>(__f),
Metadata
Metadata
Assignees
Labels
bugzillaIssues migrated from bugzillaIssues migrated from bugzillac++clang:frontendLanguage frontend issues, e.g. anything involving "Sema"Language frontend issues, e.g. anything involving "Sema"rejects-valid