public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/105386] New: Tuple in unevaluated context is instantiated; creates reference to void
@ 2022-04-26 0:31 cuzdav at gmail dot com
2022-04-26 6:59 ` [Bug c++/105386] [11/12 Regression] " rguenth at gcc dot gnu.org
` (6 more replies)
0 siblings, 7 replies; 8+ messages in thread
From: cuzdav at gmail dot com @ 2022-04-26 0:31 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105386
Bug ID: 105386
Summary: Tuple in unevaluated context is instantiated; creates
reference to void
Product: gcc
Version: 11.2.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: cuzdav at gmail dot com
Target Milestone: ---
Created attachment 52878
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=52878&action=edit
preprocessed code
Starting with g++11.2 some of meta-programming code started to fail.
While instantiating a tuple in an unevaluated context, it now complains that
the tuple contains a void member and it's creating a reference to void, yet it
is the same type as in the working case, just computed differently.
Output of g++ -v
(base) bash-4.2$ /opt/imc/gcc-11.2.0/bin/g++ -v
Using built-in specs.
COLLECT_GCC=/opt/imc/gcc-11.2.0/bin/g++
COLLECT_LTO_WRAPPER=/opt/imc/gcc-11.2.0/libexec/gcc/x86_64-pc-linux-gnu/11.2.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc-11.2.0/configure --prefix=/opt/imc/gcc-11.2.0
--enable-languages=c,c++,fortran,lto --disable-multilib
--with-build-time-tools=/opt/buildagent/work/d7a993299378ca7e/11.2.0/INSTALLDIR//opt/imc/gcc-11.2.0/bin
--enable-libstdcxx-time=rt
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 11.2.0 (GCC)
Code appears in its entirety in attachment, but here is the main focus of the
error:
class Chunk { };
using ChunkMetaData = std::tuple<void, Chunk, void>;
template <typename MessageT> ChunkMetaData chunkMetaData(MessageT&&);
template <typename MessageChunkT>
class ChunkSeq
{
public:
////////////////////////////////////////
using good_type = ChunkMetaData;
#ifdef SHOWBUG
using bad_type = decltype(chunkMetaData(std::declval<MessageChunkT>()));
static_assert(std::is_same_v<good_type, bad_type>);
using MetaData = bad_type;
#else
using MetaData = good_type;
#endif
////////////////////////////////////////
In gcc10, when SHOWBUG is defined, it still builds. The static assertion
passes. With gcc11 and 12, it fails, upset about a tuple creating a reference
to void.
Live example:
https://godbolt.org/z/4Wq3s936W
Errors:
In file included from krx/feed/sr10/foo.cpp:1:
/opt/imc/gcc-11.2.0/lib/gcc/x86_64-pc-linux-gnu/11.2.0/../../../../include/c++/11.2.0/tuple:
In instantiation of ‘struct std::_Head_base<2, void, false>’:
/opt/imc/gcc-11.2.0/lib/gcc/x86_64-pc-linux-gnu/11.2.0/../../../../include/c++/11.2.0/tuple:407:12:
required from ‘struct std::_Tuple_impl<2, void>’
/opt/imc/gcc-11.2.0/lib/gcc/x86_64-pc-linux-gnu/11.2.0/../../../../include/c++/11.2.0/tuple:244:12:
required from ‘struct std::_Tuple_impl<0, void, Chunk, void>’
/opt/imc/gcc-11.2.0/lib/gcc/x86_64-pc-linux-gnu/11.2.0/../../../../include/c++/11.2.0/tuple:599:11:
required from ‘class std::tuple<void, Chunk, void>’
krx/feed/sr10/foo.cpp:171:42: [ skipping 2 instantiation contexts, use
-ftemplate-backtrace-limit=0 to disable ]
krx/feed/sr10/foo.cpp:111:57: required from ‘constexpr const bool
InvertPredicate<FieldIsPartialBegin<Chunk> >::value<PartialField<0> >’
krx/feed/sr10/foo.cpp:122:11: required from ‘struct
RemoveIfImpl<InvertPredicate<FieldIsPartialBegin<Chunk> >,
std::tuple<PartialField<0>, PartialField<1> > >’
krx/feed/sr10/foo.cpp:235:7: required by substitution of ‘template<class T>
using PartialStartField = typename KeepIf<FieldIsPartialBegin<T>, typename
RemoveIfImpl<InvertPredicate<ChunkHasPartialType<T> >,
std::tuple<PartialField<0>, PartialField<1> > >::type>::type [with T = Chunk]’
krx/feed/sr10/foo.cpp:240:47: required from ‘constexpr const bool
HasPartialBegin::value<Chunk>’
krx/feed/sr10/foo.cpp:111:57: required from ‘constexpr const bool
InvertPredicate<HasPartialBegin>::value<Chunk>’
krx/feed/sr10/foo.cpp:122:11: required from ‘struct
RemoveIfImpl<InvertPredicate<HasPartialBegin>, std::tuple<Chunk> >’
krx/feed/sr10/foo.cpp:247:6: required from here
/opt/imc/gcc-11.2.0/lib/gcc/x86_64-pc-linux-gnu/11.2.0/../../../../include/c++/11.2.0/tuple:182:17:
error: forming reference to void
182 | constexpr _Head_base(const _Head& __h)
| ^~~~~~~~~~
/opt/imc/gcc-11.2.0/lib/gcc/x86_64-pc-linux-gnu/11.2.0/../../../../include/c++/11.2.0/tuple:219:7:
error: forming reference to void
219 | _M_head(_Head_base& __b) noexcept { return __b._M_head_impl; }
| ^~~~~~~
/opt/imc/gcc-11.2.0/lib/gcc/x86_64-pc-linux-gnu/11.2.0/../../../../include/c++/11.2.0/tuple:222:7:
error: forming reference to void
222 | _M_head(const _Head_base& __b) noexcept { return
__b._M_head_impl; }
| ^~~~~~~
/opt/imc/gcc-11.2.0/lib/gcc/x86_64-pc-linux-gnu/11.2.0/../../../../include/c++/11.2.0/tuple:224:13:
error: ‘std::_Head_base<_Idx, _Head, false>::_M_head_impl’ has incomplete type
224 | _Head _M_head_impl;
| ^~~~~~~~~~~~
/opt/imc/gcc-11.2.0/lib/gcc/x86_64-pc-linux-gnu/11.2.0/../../../../include/c++/11.2.0/tuple:224:13:
error: invalid use of ‘void’
In file included from krx/feed/sr10/foo.cpp:1:
/opt/imc/gcc-11.2.0/lib/gcc/x86_64-pc-linux-gnu/11.2.0/../../../../include/c++/11.2.0/tuple:
In instantiation of ‘struct std::_Tuple_impl<2, void>’:
/opt/imc/gcc-11.2.0/lib/gcc/x86_64-pc-linux-gnu/11.2.0/../../../../include/c++/11.2.0/tuple:244:12:
recursively required from ‘struct std::_Tuple_impl<1, Chunk, void>’
/opt/imc/gcc-11.2.0/lib/gcc/x86_64-pc-linux-gnu/11.2.0/../../../../include/c++/11.2.0/tuple:244:12:
required from ‘struct std::_Tuple_impl<0, void, Chunk, void>’
/opt/imc/gcc-11.2.0/lib/gcc/x86_64-pc-linux-gnu/11.2.0/../../../../include/c++/11.2.0/tuple:599:11:
required from ‘class std::tuple<void, Chunk, void>’
krx/feed/sr10/foo.cpp:171:42: required from ‘class ChunkSeq<Chunk>’
krx/feed/sr10/foo.cpp:231:35: required from ‘constexpr const bool
FieldIsPartialBegin<Chunk>::value<PartialField<0> >’
krx/feed/sr10/foo.cpp:111:57: required from ‘constexpr const bool
InvertPredicate<FieldIsPartialBegin<Chunk> >::value<PartialField<0> >’
krx/feed/sr10/foo.cpp:122:11: required from ‘struct
RemoveIfImpl<InvertPredicate<FieldIsPartialBegin<Chunk> >,
std::tuple<PartialField<0>, PartialField<1> > >’
krx/feed/sr10/foo.cpp:235:7: required by substitution of ‘template<class T>
using PartialStartField = typename KeepIf<FieldIsPartialBegin<T>, typename
RemoveIfImpl<InvertPredicate<ChunkHasPartialType<T> >,
std::tuple<PartialField<0>, PartialField<1> > >::type>::type [with T = Chunk]’
krx/feed/sr10/foo.cpp:240:47: required from ‘constexpr const bool
HasPartialBegin::value<Chunk>’
krx/feed/sr10/foo.cpp:111:57: required from ‘constexpr const bool
InvertPredicate<HasPartialBegin>::value<Chunk>’
krx/feed/sr10/foo.cpp:122:11: required from ‘struct
RemoveIfImpl<InvertPredicate<HasPartialBegin>, std::tuple<Chunk> >’
krx/feed/sr10/foo.cpp:247:6: required from here
/opt/imc/gcc-11.2.0/lib/gcc/x86_64-pc-linux-gnu/11.2.0/../../../../include/c++/11.2.0/tuple:415:7:
error: forming reference to void
415 | _M_head(_Tuple_impl& __t) noexcept { return _Base::_M_head(__t);
}
| ^~~~~~~
/opt/imc/gcc-11.2.0/lib/gcc/x86_64-pc-linux-gnu/11.2.0/../../../../include/c++/11.2.0/tuple:418:7:
error: forming reference to void
418 | _M_head(const _Tuple_impl& __t) noexcept { return
_Base::_M_head(__t); }
| ^~~~~~~
/opt/imc/gcc-11.2.0/lib/gcc/x86_64-pc-linux-gnu/11.2.0/../../../../include/c++/11.2.0/tuple:425:7:
error: forming reference to void
425 | _Tuple_impl(const _Head& __head)
| ^~~~~~~~~~~
/opt/imc/gcc-11.2.0/lib/gcc/x86_64-pc-linux-gnu/11.2.0/../../../../include/c++/11.2.0/tuple:466:9:
error: forming reference to void
466 | _Tuple_impl(allocator_arg_t __tag, const _Alloc& __a,
| ^~~~~~~~~~~
/opt/imc/gcc-11.2.0/lib/gcc/x86_64-pc-linux-gnu/11.2.0/../../../../include/c++/11.2.0/tuple:
In instantiation of ‘struct std::_Tuple_impl<1, Chunk, void>’:
/opt/imc/gcc-11.2.0/lib/gcc/x86_64-pc-linux-gnu/11.2.0/../../../../include/c++/11.2.0/tuple:244:12:
required from ‘struct std::_Tuple_impl<0, void, Chunk, void>’
/opt/imc/gcc-11.2.0/lib/gcc/x86_64-pc-linux-gnu/11.2.0/../../../../include/c++/11.2.0/tuple:599:11:
required from ‘class std::tuple<void, Chunk, void>’
krx/feed/sr10/foo.cpp:171:42: required from ‘class ChunkSeq<Chunk>’
krx/feed/sr10/foo.cpp:231:35: required from ‘constexpr const bool
FieldIsPartialBegin<Chunk>::value<PartialField<0> >’
krx/feed/sr10/foo.cpp:111:57: required from ‘constexpr const bool
InvertPredicate<FieldIsPartialBegin<Chunk> >::value<PartialField<0> >’
krx/feed/sr10/foo.cpp:122:11: required from ‘struct
RemoveIfImpl<InvertPredicate<FieldIsPartialBegin<Chunk> >,
std::tuple<PartialField<0>, PartialField<1> > >’
krx/feed/sr10/foo.cpp:235:7: required by substitution of ‘template<class T>
using PartialStartField = typename KeepIf<FieldIsPartialBegin<T>, typename
RemoveIfImpl<InvertPredicate<ChunkHasPartialType<T> >,
std::tuple<PartialField<0>, PartialField<1> > >::type>::type [with T = Chunk]’
krx/feed/sr10/foo.cpp:240:47: required from ‘constexpr const bool
HasPartialBegin::value<Chunk>’
krx/feed/sr10/foo.cpp:111:57: required from ‘constexpr const bool
InvertPredicate<HasPartialBegin>::value<Chunk>’
krx/feed/sr10/foo.cpp:122:11: required from ‘struct
RemoveIfImpl<InvertPredicate<HasPartialBegin>, std::tuple<Chunk> >’
krx/feed/sr10/foo.cpp:247:6: required from here
/opt/imc/gcc-11.2.0/lib/gcc/x86_64-pc-linux-gnu/11.2.0/../../../../include/c++/11.2.0/tuple:269:7:
error: forming reference to void
269 | _Tuple_impl(const _Head& __head, const _Tail&... __tail)
| ^~~~~~~~~~~
/opt/imc/gcc-11.2.0/lib/gcc/x86_64-pc-linux-gnu/11.2.0/../../../../include/c++/11.2.0/tuple:319:9:
error: forming reference to void
319 | _Tuple_impl(allocator_arg_t __tag, const _Alloc& __a,
| ^~~~~~~~~~~
In file included from krx/feed/sr10/foo.cpp:1:
/opt/imc/gcc-11.2.0/lib/gcc/x86_64-pc-linux-gnu/11.2.0/../../../../include/c++/11.2.0/tuple:
In instantiation of ‘struct std::_Head_base<0, void, false>’:
/opt/imc/gcc-11.2.0/lib/gcc/x86_64-pc-linux-gnu/11.2.0/../../../../include/c++/11.2.0/tuple:244:12:
required from ‘struct std::_Tuple_impl<0, void, Chunk, void>’
/opt/imc/gcc-11.2.0/lib/gcc/x86_64-pc-linux-gnu/11.2.0/../../../../include/c++/11.2.0/tuple:599:11:
required from ‘class std::tuple<void, Chunk, void>’
krx/feed/sr10/foo.cpp:171:42: required from ‘class ChunkSeq<Chunk>’
krx/feed/sr10/foo.cpp:231:35: required from ‘constexpr const bool
FieldIsPartialBegin<Chunk>::value<PartialField<0> >’
krx/feed/sr10/foo.cpp:111:57: required from ‘constexpr const bool
InvertPredicate<FieldIsPartialBegin<Chunk> >::value<PartialField<0> >’
krx/feed/sr10/foo.cpp:122:11: required from ‘struct
RemoveIfImpl<InvertPredicate<FieldIsPartialBegin<Chunk> >,
std::tuple<PartialField<0>, PartialField<1> > >’
krx/feed/sr10/foo.cpp:235:7: required by substitution of ‘template<class T>
using PartialStartField = typename KeepIf<FieldIsPartialBegin<T>, typename
RemoveIfImpl<InvertPredicate<ChunkHasPartialType<T> >,
std::tuple<PartialField<0>, PartialField<1> > >::type>::type [with T = Chunk]’
krx/feed/sr10/foo.cpp:240:47: required from ‘constexpr const bool
HasPartialBegin::value<Chunk>’
krx/feed/sr10/foo.cpp:111:57: required from ‘constexpr const bool
InvertPredicate<HasPartialBegin>::value<Chunk>’
krx/feed/sr10/foo.cpp:122:11: required from ‘struct
RemoveIfImpl<InvertPredicate<HasPartialBegin>, std::tuple<Chunk> >’
krx/feed/sr10/foo.cpp:247:6: required from here
/opt/imc/gcc-11.2.0/lib/gcc/x86_64-pc-linux-gnu/11.2.0/../../../../include/c++/11.2.0/tuple:182:17:
error: forming reference to void
182 | constexpr _Head_base(const _Head& __h)
| ^~~~~~~~~~
/opt/imc/gcc-11.2.0/lib/gcc/x86_64-pc-linux-gnu/11.2.0/../../../../include/c++/11.2.0/tuple:219:7:
error: forming reference to void
219 | _M_head(_Head_base& __b) noexcept { return __b._M_head_impl; }
| ^~~~~~~
/opt/imc/gcc-11.2.0/lib/gcc/x86_64-pc-linux-gnu/11.2.0/../../../../include/c++/11.2.0/tuple:222:7:
error: forming reference to void
222 | _M_head(const _Head_base& __b) noexcept { return
__b._M_head_impl; }
| ^~~~~~~
/opt/imc/gcc-11.2.0/lib/gcc/x86_64-pc-linux-gnu/11.2.0/../../../../include/c++/11.2.0/tuple:224:13:
error: ‘std::_Head_base<_Idx, _Head, false>::_M_head_impl’ has incomplete type
224 | _Head _M_head_impl;
| ^~~~~~~~~~~~
/opt/imc/gcc-11.2.0/lib/gcc/x86_64-pc-linux-gnu/11.2.0/../../../../include/c++/11.2.0/tuple:224:13:
error: invalid use of ‘void’
In file included from krx/feed/sr10/foo.cpp:1:
/opt/imc/gcc-11.2.0/lib/gcc/x86_64-pc-linux-gnu/11.2.0/../../../../include/c++/11.2.0/tuple:
In instantiation of ‘struct std::_Tuple_impl<0, void, Chunk, void>’:
/opt/imc/gcc-11.2.0/lib/gcc/x86_64-pc-linux-gnu/11.2.0/../../../../include/c++/11.2.0/tuple:599:11:
required from ‘class std::tuple<void, Chunk, void>’
krx/feed/sr10/foo.cpp:171:42: required from ‘class ChunkSeq<Chunk>’
krx/feed/sr10/foo.cpp:231:35: required from ‘constexpr const bool
FieldIsPartialBegin<Chunk>::value<PartialField<0> >’
krx/feed/sr10/foo.cpp:111:57: required from ‘constexpr const bool
InvertPredicate<FieldIsPartialBegin<Chunk> >::value<PartialField<0> >’
krx/feed/sr10/foo.cpp:122:11: required from ‘struct
RemoveIfImpl<InvertPredicate<FieldIsPartialBegin<Chunk> >,
std::tuple<PartialField<0>, PartialField<1> > >’
krx/feed/sr10/foo.cpp:235:7: required by substitution of ‘template<class T>
using PartialStartField = typename KeepIf<FieldIsPartialBegin<T>, typename
RemoveIfImpl<InvertPredicate<ChunkHasPartialType<T> >,
std::tuple<PartialField<0>, PartialField<1> > >::type>::type [with T = Chunk]’
krx/feed/sr10/foo.cpp:240:47: required from ‘constexpr const bool
HasPartialBegin::value<Chunk>’
krx/feed/sr10/foo.cpp:111:57: required from ‘constexpr const bool
InvertPredicate<HasPartialBegin>::value<Chunk>’
krx/feed/sr10/foo.cpp:122:11: required from ‘struct
RemoveIfImpl<InvertPredicate<HasPartialBegin>, std::tuple<Chunk> >’
krx/feed/sr10/foo.cpp:247:6: required from here
/opt/imc/gcc-11.2.0/lib/gcc/x86_64-pc-linux-gnu/11.2.0/../../../../include/c++/11.2.0/tuple:254:7:
error: forming reference to void
254 | _M_head(_Tuple_impl& __t) noexcept { return _Base::_M_head(__t);
}
| ^~~~~~~
/opt/imc/gcc-11.2.0/lib/gcc/x86_64-pc-linux-gnu/11.2.0/../../../../include/c++/11.2.0/tuple:257:7:
error: forming reference to void
257 | _M_head(const _Tuple_impl& __t) noexcept { return
_Base::_M_head(__t); }
| ^~~~~~~
/opt/imc/gcc-11.2.0/lib/gcc/x86_64-pc-linux-gnu/11.2.0/../../../../include/c++/11.2.0/tuple:269:7:
error: forming reference to void
269 | _Tuple_impl(const _Head& __head, const _Tail&... __tail)
| ^~~~~~~~~~~
/opt/imc/gcc-11.2.0/lib/gcc/x86_64-pc-linux-gnu/11.2.0/../../../../include/c++/11.2.0/tuple:319:9:
error: forming reference to void
319 | _Tuple_impl(allocator_arg_t __tag, const _Alloc& __a,
| ^~~~~~~~~~~
/opt/imc/gcc-11.2.0/lib/gcc/x86_64-pc-linux-gnu/11.2.0/../../../../include/c++/11.2.0/tuple:
In instantiation of ‘class std::tuple<void, Chunk, void>’:
krx/feed/sr10/foo.cpp:171:42: required from ‘class ChunkSeq<Chunk>’
krx/feed/sr10/foo.cpp:231:35: required from ‘constexpr const bool
FieldIsPartialBegin<Chunk>::value<PartialField<0> >’
krx/feed/sr10/foo.cpp:111:57: required from ‘constexpr const bool
InvertPredicate<FieldIsPartialBegin<Chunk> >::value<PartialField<0> >’
krx/feed/sr10/foo.cpp:122:11: required from ‘struct
RemoveIfImpl<InvertPredicate<FieldIsPartialBegin<Chunk> >,
std::tuple<PartialField<0>, PartialField<1> > >’
krx/feed/sr10/foo.cpp:235:7: required by substitution of ‘template<class T>
using PartialStartField = typename KeepIf<FieldIsPartialBegin<T>, typename
RemoveIfImpl<InvertPredicate<ChunkHasPartialType<T> >,
std::tuple<PartialField<0>, PartialField<1> > >::type>::type [with T = Chunk]’
krx/feed/sr10/foo.cpp:240:47: required from ‘constexpr const bool
HasPartialBegin::value<Chunk>’
krx/feed/sr10/foo.cpp:111:57: required from ‘constexpr const bool
InvertPredicate<HasPartialBegin>::value<Chunk>’
krx/feed/sr10/foo.cpp:122:11: required from ‘struct
RemoveIfImpl<InvertPredicate<HasPartialBegin>, std::tuple<Chunk> >’
krx/feed/sr10/foo.cpp:247:6: required from here
/opt/imc/gcc-11.2.0/lib/gcc/x86_64-pc-linux-gnu/11.2.0/../../../../include/c++/11.2.0/tuple:621:72:
error: forming reference to void
621 | _TCC<_Cond>::template
__is_implicitly_constructible<_Args...>(),
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~
/opt/imc/gcc-11.2.0/lib/gcc/x86_64-pc-linux-gnu/11.2.0/../../../../include/c++/11.2.0/tuple:627:72:
error: forming reference to void
627 | _TCC<_Cond>::template
__is_explicitly_constructible<_Args...>(),
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~
/opt/imc/gcc-11.2.0/lib/gcc/x86_64-pc-linux-gnu/11.2.0/../../../../include/c++/11.2.0/tuple:621:72:
error: forming reference to void
621 | _TCC<_Cond>::template
__is_implicitly_constructible<_Args...>(),
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~
/opt/imc/gcc-11.2.0/lib/gcc/x86_64-pc-linux-gnu/11.2.0/../../../../include/c++/11.2.0/tuple:627:72:
error: forming reference to void
627 | _TCC<_Cond>::template
__is_explicitly_constructible<_Args...>(),
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~
In file included from krx/feed/sr10/foo.cpp:1:
/opt/imc/gcc-11.2.0/lib/gcc/x86_64-pc-linux-gnu/11.2.0/../../../../include/c++/11.2.0/tuple:888:71:
error: forming reference to void
888 | operator=(typename conditional<__assignable<const
_Elements&...>(),
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~
/opt/imc/gcc-11.2.0/lib/gcc/x86_64-pc-linux-gnu/11.2.0/../../../../include/c++/11.2.0/tuple:888:71:
error: no matching function for call to ‘std::tuple<void, Chunk,
void>::<expression error>()’
In file included from krx/feed/sr10/foo.cpp:1:
/opt/imc/gcc-11.2.0/lib/gcc/x86_64-pc-linux-gnu/11.2.0/../../../../include/c++/11.2.0/tuple:633:9:
note: candidate: ‘template<class ... _UElements> static constexpr
std::__enable_if_t<(sizeof... (_UElements) == sizeof... (_Elements)), bool>
std::tuple<_Elements>::__assignable() [with _UElements = {_UElements ...};
_Elements = {void, Chunk, void}]’
633 | __assignable()
| ^~~~~~~~~~~~
/opt/imc/gcc-11.2.0/lib/gcc/x86_64-pc-linux-gnu/11.2.0/../../../../include/c++/11.2.0/tuple:633:9:
note: template argument deduction/substitution failed:
/opt/imc/gcc-11.2.0/lib/gcc/x86_64-pc-linux-gnu/11.2.0/../../../../include/c++/11.2.0/tuple:
In instantiation of ‘static constexpr std::__enable_if_t<(sizeof...
(_UElements) == sizeof... (_Elements)), bool>
std::tuple<_Elements>::__assignable() [with _UElements = {void, Chunk, void};
_Elements = {void, Chunk, void}; std::__enable_if_t<(sizeof... (_UElements) ==
sizeof... (_Elements)), bool> = bool]’:
/opt/imc/gcc-11.2.0/lib/gcc/x86_64-pc-linux-gnu/11.2.0/../../../../include/c++/11.2.0/tuple:899:64:
required from ‘class std::tuple<void, Chunk, void>’
krx/feed/sr10/foo.cpp:171:42: required from ‘class ChunkSeq<Chunk>’
krx/feed/sr10/foo.cpp:231:35: required from ‘constexpr const bool
FieldIsPartialBegin<Chunk>::value<PartialField<0> >’
krx/feed/sr10/foo.cpp:111:57: required from ‘constexpr const bool
InvertPredicate<FieldIsPartialBegin<Chunk> >::value<PartialField<0> >’
krx/feed/sr10/foo.cpp:122:11: required from ‘struct
RemoveIfImpl<InvertPredicate<FieldIsPartialBegin<Chunk> >,
std::tuple<PartialField<0>, PartialField<1> > >’
krx/feed/sr10/foo.cpp:235:7: required by substitution of ‘template<class T>
using PartialStartField = typename KeepIf<FieldIsPartialBegin<T>, typename
RemoveIfImpl<InvertPredicate<ChunkHasPartialType<T> >,
std::tuple<PartialField<0>, PartialField<1> > >::type>::type [with T = Chunk]’
krx/feed/sr10/foo.cpp:240:47: required from ‘constexpr const bool
HasPartialBegin::value<Chunk>’
krx/feed/sr10/foo.cpp:111:57: required from ‘constexpr const bool
InvertPredicate<HasPartialBegin>::value<Chunk>’
krx/feed/sr10/foo.cpp:122:11: required from ‘struct
RemoveIfImpl<InvertPredicate<HasPartialBegin>, std::tuple<Chunk> >’
krx/feed/sr10/foo.cpp:247:6: required from here
/opt/imc/gcc-11.2.0/lib/gcc/x86_64-pc-linux-gnu/11.2.0/../../../../include/c++/11.2.0/tuple:634:68:
error: forming reference to void
634 | { return __and_<is_assignable<_Elements&,
_UElements>...>::value; }
|
^~~~~
In file included from krx/feed/sr10/foo.cpp:1:
/opt/imc/gcc-11.2.0/lib/gcc/x86_64-pc-linux-gnu/11.2.0/../../../../include/c++/11.2.0/tuple:
In instantiation of ‘class std::tuple<void, Chunk, void>’:
krx/feed/sr10/foo.cpp:171:42: required from ‘class ChunkSeq<Chunk>’
krx/feed/sr10/foo.cpp:231:35: required from ‘constexpr const bool
FieldIsPartialBegin<Chunk>::value<PartialField<0> >’
krx/feed/sr10/foo.cpp:111:57: required from ‘constexpr const bool
InvertPredicate<FieldIsPartialBegin<Chunk> >::value<PartialField<0> >’
krx/feed/sr10/foo.cpp:122:11: required from ‘struct
RemoveIfImpl<InvertPredicate<FieldIsPartialBegin<Chunk> >,
std::tuple<PartialField<0>, PartialField<1> > >’
krx/feed/sr10/foo.cpp:235:7: required by substitution of ‘template<class T>
using PartialStartField = typename KeepIf<FieldIsPartialBegin<T>, typename
RemoveIfImpl<InvertPredicate<ChunkHasPartialType<T> >,
std::tuple<PartialField<0>, PartialField<1> > >::type>::type [with T = Chunk]’
krx/feed/sr10/foo.cpp:240:47: required from ‘constexpr const bool
HasPartialBegin::value<Chunk>’
krx/feed/sr10/foo.cpp:111:57: required from ‘constexpr const bool
InvertPredicate<HasPartialBegin>::value<Chunk>’
krx/feed/sr10/foo.cpp:122:11: required from ‘struct
RemoveIfImpl<InvertPredicate<HasPartialBegin>, std::tuple<Chunk> >’
krx/feed/sr10/foo.cpp:247:6: required from here
/opt/imc/gcc-11.2.0/lib/gcc/x86_64-pc-linux-gnu/11.2.0/../../../../include/c++/11.2.0/tuple:899:64:
in ‘constexpr’ expansion of ‘std::tuple<void, Chunk,
void>::__assignable<void, Chunk, void>()’
/opt/imc/gcc-11.2.0/lib/gcc/x86_64-pc-linux-gnu/11.2.0/../../../../include/c++/11.2.0/tuple:899:7:
error: ‘constexpr’ call flows off the end of the function
899 | operator=(typename conditional<__assignable<_Elements...>(),
| ^~~~~~~~
/opt/imc/gcc-11.2.0/lib/gcc/x86_64-pc-linux-gnu/11.2.0/../../../../include/c++/11.2.0/tuple:899:64:
note: in template argument for type ‘bool’
899 | operator=(typename conditional<__assignable<_Elements...>(),
| ~~~~~~~~~~~~~~~~~~~~~~~~~~^~
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug c++/105386] [11/12 Regression] Tuple in unevaluated context is instantiated; creates reference to void
2022-04-26 0:31 [Bug c++/105386] New: Tuple in unevaluated context is instantiated; creates reference to void cuzdav at gmail dot com
@ 2022-04-26 6:59 ` rguenth at gcc dot gnu.org
2022-04-26 9:30 ` jakub at gcc dot gnu.org
` (5 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: rguenth at gcc dot gnu.org @ 2022-04-26 6:59 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105386
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Summary|Tuple in unevaluated |[11/12 Regression] Tuple in
|context is instantiated; |unevaluated context is
|creates reference to void |instantiated; creates
| |reference to void
Keywords| |needs-bisection,
| |rejects-valid
Last reconfirmed| |2022-04-26
Status|UNCONFIRMED |NEW
Known to fail| |11.2.1, 12.0
Target Milestone|--- |11.4
Known to work| |10.3.1
Ever confirmed|0 |1
--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
Confirmed. clang 11 also accepts it.
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug c++/105386] [11/12 Regression] Tuple in unevaluated context is instantiated; creates reference to void
2022-04-26 0:31 [Bug c++/105386] New: Tuple in unevaluated context is instantiated; creates reference to void cuzdav at gmail dot com
2022-04-26 6:59 ` [Bug c++/105386] [11/12 Regression] " rguenth at gcc dot gnu.org
@ 2022-04-26 9:30 ` jakub at gcc dot gnu.org
2022-04-26 12:19 ` ppalka at gcc dot gnu.org
` (4 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: jakub at gcc dot gnu.org @ 2022-04-26 9:30 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105386
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords|needs-bisection |
CC| |jakub at gcc dot gnu.org,
| |ppalka at gcc dot gnu.org
--- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Started with r11-434-g115232b778943be075fc4df991e03d9387563114
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug c++/105386] [11/12 Regression] Tuple in unevaluated context is instantiated; creates reference to void
2022-04-26 0:31 [Bug c++/105386] New: Tuple in unevaluated context is instantiated; creates reference to void cuzdav at gmail dot com
2022-04-26 6:59 ` [Bug c++/105386] [11/12 Regression] " rguenth at gcc dot gnu.org
2022-04-26 9:30 ` jakub at gcc dot gnu.org
@ 2022-04-26 12:19 ` ppalka at gcc dot gnu.org
2022-04-26 14:54 ` cvs-commit at gcc dot gnu.org
` (3 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: ppalka at gcc dot gnu.org @ 2022-04-26 12:19 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105386
Patrick Palka <ppalka at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |ASSIGNED
Assignee|unassigned at gcc dot gnu.org |ppalka at gcc dot gnu.org
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug c++/105386] [11/12 Regression] Tuple in unevaluated context is instantiated; creates reference to void
2022-04-26 0:31 [Bug c++/105386] New: Tuple in unevaluated context is instantiated; creates reference to void cuzdav at gmail dot com
` (2 preceding siblings ...)
2022-04-26 12:19 ` ppalka at gcc dot gnu.org
@ 2022-04-26 14:54 ` cvs-commit at gcc dot gnu.org
2022-04-26 15:20 ` [Bug c++/105386] [11 " ppalka at gcc dot gnu.org
` (2 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-04-26 14:54 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105386
--- Comment #3 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Patrick Palka <ppalka@gcc.gnu.org>:
https://gcc.gnu.org/g:b6a48401da51e9042b6f0822d532b3b472492658
commit r12-8270-gb6a48401da51e9042b6f0822d532b3b472492658
Author: Patrick Palka <ppalka@redhat.com>
Date: Tue Apr 26 10:53:38 2022 -0400
c++: decltype of non-dependent call of class type [PR105386]
We need to pass tf_decltype when instantiating a non-dependent decltype
operand, like tsubst does in the dependent case, so that we don't force
completion of a prvalue operand's class type.
PR c++/105386
gcc/cp/ChangeLog:
* semantics.cc (finish_decltype_type): Pass tf_decltype to
instantiate_non_dependent_expr_sfinae.
gcc/testsuite/ChangeLog:
* g++.dg/cpp0x/decltype81.C: New test.
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug c++/105386] [11 Regression] Tuple in unevaluated context is instantiated; creates reference to void
2022-04-26 0:31 [Bug c++/105386] New: Tuple in unevaluated context is instantiated; creates reference to void cuzdav at gmail dot com
` (3 preceding siblings ...)
2022-04-26 14:54 ` cvs-commit at gcc dot gnu.org
@ 2022-04-26 15:20 ` ppalka at gcc dot gnu.org
2022-04-28 15:39 ` cvs-commit at gcc dot gnu.org
2022-04-28 15:40 ` ppalka at gcc dot gnu.org
6 siblings, 0 replies; 8+ messages in thread
From: ppalka at gcc dot gnu.org @ 2022-04-26 15:20 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105386
Patrick Palka <ppalka at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Summary|[11/12 Regression] Tuple in |[11 Regression] Tuple in
|unevaluated context is |unevaluated context is
|instantiated; creates |instantiated; creates
|reference to void |reference to void
--- Comment #4 from Patrick Palka <ppalka at gcc dot gnu.org> ---
Fixed for GCC 12 so far.
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug c++/105386] [11 Regression] Tuple in unevaluated context is instantiated; creates reference to void
2022-04-26 0:31 [Bug c++/105386] New: Tuple in unevaluated context is instantiated; creates reference to void cuzdav at gmail dot com
` (4 preceding siblings ...)
2022-04-26 15:20 ` [Bug c++/105386] [11 " ppalka at gcc dot gnu.org
@ 2022-04-28 15:39 ` cvs-commit at gcc dot gnu.org
2022-04-28 15:40 ` ppalka at gcc dot gnu.org
6 siblings, 0 replies; 8+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-04-28 15:39 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105386
--- Comment #5 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-11 branch has been updated by Patrick Palka
<ppalka@gcc.gnu.org>:
https://gcc.gnu.org/g:8969d00bf16a8f4de79306010fca8f14f91c171d
commit r11-9947-g8969d00bf16a8f4de79306010fca8f14f91c171d
Author: Patrick Palka <ppalka@redhat.com>
Date: Tue Apr 26 10:53:38 2022 -0400
c++: decltype of non-dependent call of class type [PR105386]
We need to pass tf_decltype when instantiating a non-dependent decltype
operand, like tsubst does in the dependent case, so that we don't force
completion of a prvalue operand's class type.
PR c++/105386
gcc/cp/ChangeLog:
* semantics.c (finish_decltype_type): Pass tf_decltype to
instantiate_non_dependent_expr_sfinae.
gcc/testsuite/ChangeLog:
* g++.dg/cpp0x/decltype81.C: New test.
(cherry picked from commit b6a48401da51e9042b6f0822d532b3b472492658)
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug c++/105386] [11 Regression] Tuple in unevaluated context is instantiated; creates reference to void
2022-04-26 0:31 [Bug c++/105386] New: Tuple in unevaluated context is instantiated; creates reference to void cuzdav at gmail dot com
` (5 preceding siblings ...)
2022-04-28 15:39 ` cvs-commit at gcc dot gnu.org
@ 2022-04-28 15:40 ` ppalka at gcc dot gnu.org
6 siblings, 0 replies; 8+ messages in thread
From: ppalka at gcc dot gnu.org @ 2022-04-28 15:40 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105386
Patrick Palka <ppalka at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution|--- |FIXED
--- Comment #6 from Patrick Palka <ppalka at gcc dot gnu.org> ---
Fixed for GCC 11.4/12, thanks for the bug report.
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2022-04-28 15:40 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-26 0:31 [Bug c++/105386] New: Tuple in unevaluated context is instantiated; creates reference to void cuzdav at gmail dot com
2022-04-26 6:59 ` [Bug c++/105386] [11/12 Regression] " rguenth at gcc dot gnu.org
2022-04-26 9:30 ` jakub at gcc dot gnu.org
2022-04-26 12:19 ` ppalka at gcc dot gnu.org
2022-04-26 14:54 ` cvs-commit at gcc dot gnu.org
2022-04-26 15:20 ` [Bug c++/105386] [11 " ppalka at gcc dot gnu.org
2022-04-28 15:39 ` cvs-commit at gcc dot gnu.org
2022-04-28 15:40 ` ppalka at gcc dot gnu.org
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).