public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/94645] New: incorrect concecpt evaluation with decltype, plus internal erropr
@ 2020-04-18  4:22 avi@cloudius-systems.com
  2020-04-18  4:26 ` [Bug c++/94645] " avi@cloudius-systems.com
                   ` (16 more replies)
  0 siblings, 17 replies; 18+ messages in thread
From: avi@cloudius-systems.com @ 2020-04-18  4:22 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94645

            Bug ID: 94645
           Summary: incorrect concecpt evaluation with decltype, plus
                    internal erropr
           Product: gcc
           Version: 10.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: avi@cloudius-systems.com
  Target Milestone: ---

Created attachment 48303
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=48303&action=edit
reduced test case (before preprocessing)

A concept involving decltype() fails to evaludate correctly in gcc 10, with
some indication the compiler has an internal error.

The same program compiles in gcc9 (with -fconcepts).

Reduced program and preprocessed output attached.

gcc 10 command line:

    g++  -std=gnu++2a -Wall -Werror  -c -o /dev/null reduced.cc 

gcc 9 command line:

    g++  -std=gnu++2a -fconcepts -Wall -Werror  -c -o /dev/null reduced.cc

gcc 10 errors:

In file included from /usr/include/c++/10/bits/stl_algobase.h:71,
                 from /usr/include/c++/10/algorithm:61,
                 from reduced.cc:1:
/usr/include/c++/10/bits/predefined_ops.h: In instantiation of 'constexpr bool
__gnu_cxx::__ops::_Iter_pred<_Predicate>::operator()(_Iterator) [with _Iterator
= std::__detail::_Node_const_iterator<std::pair<const
std::__cxx11::basic_string<char>, p::feature>, false, true>; _Predicate =
operator<<(std::ostream&, l<p>)::<lambda(const value_type&)>]':
/usr/include/c++/10/bits/stl_algobase.h:1906:42:   required from 'constexpr
_InputIterator std::__find_if(_InputIterator, _InputIterator, _Predicate,
std::input_iterator_tag) [with _InputIterator =
std::__detail::_Node_const_iterator<std::pair<const
std::__cxx11::basic_string<char>, p::feature>, false, true>; _Predicate =
__gnu_cxx::__ops::_Iter_pred<operator<<(std::ostream&, l<p>)::<lambda(const
value_type&)> >]'
/usr/include/c++/10/bits/stl_algobase.h:1965:23:   required from 'constexpr
_Iterator std::__find_if(_Iterator, _Iterator, _Predicate) [with _Iterator =
std::__detail::_Node_const_iterator<std::pair<const
std::__cxx11::basic_string<char>, p::feature>, false, true>; _Predicate =
__gnu_cxx::__ops::_Iter_pred<operator<<(std::ostream&, l<p>)::<lambda(const
value_type&)> >]'
/usr/include/c++/10/bits/stl_algo.h:3928:28:   required from 'constexpr _IIter
std::find_if(_IIter, _IIter, _Predicate) [with _IIter =
std::__detail::_Node_const_iterator<std::pair<const
std::__cxx11::basic_string<char>, p::feature>, false, true>; _Predicate =
operator<<(std::ostream&, l<p>)::<lambda(const value_type&)>]'
reduced.cc:12:7:   recursively required from 'std::ostream&
operator<<(std::ostream&, std::vector<a>) [with a = l<p>; std::ostream =
std::basic_ostream<char>]'
reduced.cc:12:7:   required from 'std::ostream& operator<<(std::ostream&,
std::vector<a>) [with a = std::vector<l<p> >; std::ostream =
std::basic_ostream<char>]'
reduced.cc:56:11:   required from 'void e::h<a>::g(const string_view&, const
string_view&) [with a = std::vector<l<p> >; std::string_view =
std::basic_string_view<char>]'
reduced.cc:23:10:   required from here
/usr/include/c++/10/bits/predefined_ops.h:316:23: error: no match for call to
'(operator<<(std::ostream&, l<p>)::<lambda(const value_type&)>) (const
std::pair<const std::__cxx11::basic_string<char>, p::feature>&)'
  316 |  { return bool(_M_pred(*__it)); }
      |                ~~~~~~~^~~~~~~
reduced.cc:37:17: note: candidate: 'operator<<(std::ostream&,
l<p>)::<lambda(const value_type&)>'
   37 |                 [opt](const typename m::value_type &) { return opt.n;
});
      |                 ^
reduced.cc:37:17: note: constraints not satisfied
reduced.cc: In instantiation of 'operator<<(std::ostream&, l<p>)::<lambda(const
value_type&)>':
/usr/include/c++/10/bits/predefined_ops.h:316:23:   required from 'constexpr
bool __gnu_cxx::__ops::_Iter_pred<_Predicate>::operator()(_Iterator) [with
_Iterator = std::__detail::_Node_const_iterator<std::pair<const
std::__cxx11::basic_string<char>, p::feature>, false, true>; _Predicate =
operator<<(std::ostream&, l<p>)::<lambda(const value_type&)>]'
/usr/include/c++/10/bits/stl_algobase.h:1906:42:   required from 'constexpr
_InputIterator std::__find_if(_InputIterator, _InputIterator, _Predicate,
std::input_iterator_tag) [with _InputIterator =
std::__detail::_Node_const_iterator<std::pair<const
std::__cxx11::basic_string<char>, p::feature>, false, true>; _Predicate =
__gnu_cxx::__ops::_Iter_pred<operator<<(std::ostream&, l<p>)::<lambda(const
value_type&)> >]'
/usr/include/c++/10/bits/stl_algobase.h:1965:23:   required from 'constexpr
_Iterator std::__find_if(_Iterator, _Iterator, _Predicate) [with _Iterator =
std::__detail::_Node_const_iterator<std::pair<const
std::__cxx11::basic_string<char>, p::feature>, false, true>; _Predicate =
__gnu_cxx::__ops::_Iter_pred<operator<<(std::ostream&, l<p>)::<lambda(const
value_type&)> >]'
/usr/include/c++/10/bits/stl_algo.h:3928:28:   required from 'constexpr _IIter
std::find_if(_IIter, _IIter, _Predicate) [with _IIter =
std::__detail::_Node_const_iterator<std::pair<const
std::__cxx11::basic_string<char>, p::feature>, false, true>; _Predicate =
operator<<(std::ostream&, l<p>)::<lambda(const value_type&)>]'
reduced.cc:12:7:   recursively required from 'std::ostream&
operator<<(std::ostream&, std::vector<a>) [with a = l<p>; std::ostream =
std::basic_ostream<char>]'
reduced.cc:12:7:   required from 'std::ostream& operator<<(std::ostream&,
std::vector<a>) [with a = std::vector<l<p> >; std::ostream =
std::basic_ostream<char>]'
reduced.cc:56:11:   required from 'void e::h<a>::g(const string_view&, const
string_view&) [with a = std::vector<l<p> >; std::string_view =
std::basic_string_view<char>]'
reduced.cc:23:10:   required from here
reduced.cc:26:31:   required for the satisfaction of 'HasMapInterface<decltype
(Mapper::map())>'

reduced.cc:26: confused by earlier errors, bailing out
Preprocessed source stored into /tmp/cccbFNij.out file, please attach this to
your bugreport.

^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2020-04-23 23:43 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-18  4:22 [Bug c++/94645] New: incorrect concecpt evaluation with decltype, plus internal erropr avi@cloudius-systems.com
2020-04-18  4:26 ` [Bug c++/94645] " avi@cloudius-systems.com
2020-04-19 21:58 ` [Bug c++/94645] incorrect concept " rafael at espindo dot la
2020-04-20  6:58 ` [Bug c++/94645] [10 Regression][concepts] incorrect concept evaluation with decltype, plus internal error rguenth at gcc dot gnu.org
2020-04-20  7:28 ` marxin at gcc dot gnu.org
2020-04-20  9:04 ` avi@cloudius-systems.com
2020-04-20  9:19 ` [Bug c++/94645] [10 Regression][concepts] incorrect concept evaluation with decltype, plus internal error since r10-7554-gf1ad7bac76b66257 marxin at gcc dot gnu.org
2020-04-20  9:19 ` marxin at gcc dot gnu.org
2020-04-21 12:52 ` ppalka at gcc dot gnu.org
2020-04-21 12:54 ` ppalka at gcc dot gnu.org
2020-04-21 15:17 ` ppalka at gcc dot gnu.org
2020-04-21 19:08 ` rafael at espindo dot la
2020-04-21 23:21 ` ppalka at gcc dot gnu.org
2020-04-23  4:38 ` jason at gcc dot gnu.org
2020-04-23 13:15 ` ppalka at gcc dot gnu.org
2020-04-23 21:42 ` cvs-commit at gcc dot gnu.org
2020-04-23 21:42 ` ppalka at gcc dot gnu.org
2020-04-23 23:43 ` rafael at espindo dot la

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).