public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* mismatched paramters in error messages are reported as expressions and not types
@ 2011-09-21 11:02 Křištof Želechovski
  2011-09-21 12:14 ` Jonathan Wakely
  0 siblings, 1 reply; 2+ messages in thread
From: Křištof Želechovski @ 2011-09-21 11:02 UTC (permalink / raw)
  To: gcc-help

g++ (4.6) recently threw at me the following error message:

doit.cpp:290:129: error: no match for ‘operator<<’ in ‘std::cout << boost::range::equal_range [with ForwardRange = boost::range_detail::transform_range<boost::value_factory<ls::file_rec<char>::as_char0>, std::vector<ls::file_rec<char> > >, Value = int, typename boost::range_iterator<const ForwardRange>::type = boost::transform_iterator<boost::value_factory<ls::file_rec<char>::as_char0>, __gnu_cxx::__normal_iterator<ls::file_rec<char>*, std::vector<ls::file_rec<char> > >, boost::use_default, boost::use_default>]((*(const boost::range_detail::transform_range<boost::value_factory<ls::file_rec<char>::as_char0>, std::vector<ls::file_rec<char> > >*)(& boost::range_detail::operator| [with InputRng = std::vector<ls::file_rec<char> >, UnaryFunction = boost::value_factory<ls::file_rec<char>::as_char0>]((* & lv_fr), (*(const boost::range_detail::transform_holder<boost::value_factory<ls::file_rec<char>::as_char0> >*)(& boost::adaptors::{anonymous}::transformed.boost::range_detail::forwarder<Holder>::operator() [with T = boost::value_factory<ls::file_rec<char>::as_char0>, Holder = boost::range_detail::transform_holder]((boost::value_factory<ls::file_rec<char>::as_char0>(), boost::value_factory<ls::file_rec<char>::as_char0>()))))))), (* &((int)a_n.std::basic_string<_CharT, _Traits, _Alloc>::operator[] [with _CharT = char, _Traits = std::char_traits<char>, _Alloc = std::allocator<char>, std::basic_string<_CharT, _Traits, _Alloc>::reference = char&, std::basic_string<_CharT, _Traits, _Alloc>::size_type = long unsigned int](0ul))))’

Am I suppposed to read and understand this?  It is overwhelming.

The same message, somewhat split, is a bit more readable:

doit.cpp:290:129: 
error: no match for ‘operator<<’ in ‘
std::cout << 
boost::range::equal_range 
[with 
ForwardRange = boost::range_detail::transform_range<boost::value_factory<ls::file_rec<char>::as_char0>, std::vector<ls::file_rec<char> > >, 
Value = int, 
typename boost::range_iterator<const ForwardRange>::type = 
boost::transform_iterator<
boost::value_factory<ls::file_rec<char>::as_char0>, __gnu_cxx::__normal_iterator<ls::file_rec<char>*, std::vector<ls::file_rec<char> > >, boost::use_default, boost::use_default>]
(
(
*
(const boost::range_detail::transform_range<boost::value_factory<ls::file_rec<char>::as_char0>, std::vector<ls::file_rec<char> > >*)
(
& boost::range_detail::operator| [with InputRng = std::vector<ls::file_rec<char> >, UnaryFunction = boost::value_factory<ls::file_rec<char>::as_char0>]
(
(* & lv_fr), 
(
*
(const boost::range_detail::transform_holder<boost::value_factory<ls::file_rec<char>::as_char0> >*)
(
& 
boost::adaptors::{anonymous}::transformed.boost::range_detail::forwarder<Holder>::operator() 
[with T = boost::value_factory<ls::file_rec<char>::as_char0>, Holder = boost::range_detail::transform_holder]
((boost::value_factory<ls::file_rec<char>::as_char0>(), boost::value_factory<ls::file_rec<char>::as_char0>()))))))), 
(
* 
&
(
(int)
a_n.
std::basic_string<_CharT, _Traits, _Alloc>::operator[] 
[with 
_CharT = char, _Traits = std::char_traits<char>, _Alloc = std::allocator<char>, 
std::basic_string<_CharT, _Traits, _Alloc>::reference = char&, std::basic_string<_CharT, _Traits, _Alloc>::size_type = long unsigned int](0ul))))’

What we can see is that the error message does not tell me the types that do not match but the expressions that do not match, and while subexpressions are sometimes marked with types, the type of the mismatched argument is only mentioned in the following notes.  I mean, is it really necessary to dump the whole expression instead of just reporting the failing argument types?  Is there a switch to turn it off?

Chris

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

* Re: mismatched paramters in error messages are reported as expressions and not types
  2011-09-21 11:02 mismatched paramters in error messages are reported as expressions and not types Křištof Želechovski
@ 2011-09-21 12:14 ` Jonathan Wakely
  0 siblings, 0 replies; 2+ messages in thread
From: Jonathan Wakely @ 2011-09-21 12:14 UTC (permalink / raw)
  To: Křištof Želechovski; +Cc: gcc-help

On 21 September 2011 12:08, Křištof Želechovski wrote:
> g++ (4.6) recently threw at me the following error message:
>
> doit.cpp:290:129: error: no match for ‘operator<<’ in ‘std::cout << boost::range::equal_range [with ForwardRange = boost::range_detail::transform_range<boost::value_factory<ls::file_rec<char>::as_char0>, std::vector<ls::file_rec<char> > >, Value = int, typename boost::range_iterator<const ForwardRange>::type = boost::transform_iterator<boost::value_factory<ls::file_rec<char>::as_char0>, __gnu_cxx::__normal_iterator<ls::file_rec<char>*, std::vector<ls::file_rec<char> > >, boost::use_default, boost::use_default>]((*(const boost::range_detail::transform_range<boost::value_factory<ls::file_rec<char>::as_char0>, std::vector<ls::file_rec<char> > >*)(& boost::range_detail::operator| [with InputRng = std::vector<ls::file_rec<char> >, UnaryFunction = boost::value_factory<ls::file_rec<char>::as_char0>]((* & lv_fr), (*(const boost::range_detail::transform_holder<boost::value_factory<ls::file_rec<char>::as_char0> >*)(& boost::adaptors::{anonymous}::transformed.boost::range_detail::forwarder<Holder>::operator() [with T = boost::value_factory<ls::file_rec<char>::as_char0>, Holder = boost::range_detail::transform_holder]((boost::value_factory<ls::file_rec<char>::as_char0>(), boost::value_factory<ls::file_rec<char>::as_char0>()))))))), (* &((int)a_n.std::basic_string<_CharT, _Traits, _Alloc>::operator[] [with _CharT = char, _Traits = std::char_traits<char>, _Alloc = std::allocator<char>, std::basic_string<_CharT, _Traits, _Alloc>::reference = char&, std::basic_string<_CharT, _Traits, _Alloc>::size_type = long unsigned int](0ul))))’
>
> Am I suppposed to read and understand this?  It is overwhelming.
>
> The same message, somewhat split, is a bit more readable:
>
> doit.cpp:290:129:
> error: no match for ‘operator<<’ in ‘
> std::cout <<
> boost::range::equal_range
> [with
> ForwardRange = boost::range_detail::transform_range<boost::value_factory<ls::file_rec<char>::as_char0>, std::vector<ls::file_rec<char> > >,
> Value = int,
> typename boost::range_iterator<const ForwardRange>::type =
> boost::transform_iterator<
> boost::value_factory<ls::file_rec<char>::as_char0>, __gnu_cxx::__normal_iterator<ls::file_rec<char>*, std::vector<ls::file_rec<char> > >, boost::use_default, boost::use_default>]
> (
> (
> *
> (const boost::range_detail::transform_range<boost::value_factory<ls::file_rec<char>::as_char0>, std::vector<ls::file_rec<char> > >*)
> (
> & boost::range_detail::operator| [with InputRng = std::vector<ls::file_rec<char> >, UnaryFunction = boost::value_factory<ls::file_rec<char>::as_char0>]
> (
> (* & lv_fr),
> (
> *
> (const boost::range_detail::transform_holder<boost::value_factory<ls::file_rec<char>::as_char0> >*)
> (
> &
> boost::adaptors::{anonymous}::transformed.boost::range_detail::forwarder<Holder>::operator()
> [with T = boost::value_factory<ls::file_rec<char>::as_char0>, Holder = boost::range_detail::transform_holder]
> ((boost::value_factory<ls::file_rec<char>::as_char0>(), boost::value_factory<ls::file_rec<char>::as_char0>()))))))),
> (
> *
> &
> (
> (int)
> a_n.
> std::basic_string<_CharT, _Traits, _Alloc>::operator[]
> [with
> _CharT = char, _Traits = std::char_traits<char>, _Alloc = std::allocator<char>,
> std::basic_string<_CharT, _Traits, _Alloc>::reference = char&, std::basic_string<_CharT, _Traits, _Alloc>::size_type = long unsigned int](0ul))))’
>
> What we can see is that the error message does not tell me the types that do not match but the expressions that do not match, and while subexpressions are sometimes marked with types, the type of the mismatched argument is only mentioned in the following notes.  I mean, is it really necessary to dump the whole expression instead of just reporting the failing argument types?  Is there a switch to turn it off?


I don't think so, although -fno-pretty-templates can make it easier to
read in some cases.

Feel free to add comments or examples to my enhancement request about
this http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49152

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

end of thread, other threads:[~2011-09-21 12:14 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-09-21 11:02 mismatched paramters in error messages are reported as expressions and not types Křištof Želechovski
2011-09-21 12:14 ` Jonathan Wakely

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