Bug 16883 - Confusing error message with Boost.Spirit
Summary: Confusing error message with Boost.Spirit
Status: RESOLVED INVALID
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 4.0.0
: P2 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords: diagnostic
Depends on:
Blocks:
 
Reported: 2004-08-04 23:20 UTC by Giovanni Bajo
Modified: 2005-07-23 22:49 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments
Preprocessed source (164.44 KB, application/octet-stream)
2004-08-04 23:20 UTC, Giovanni Bajo
Details
Comeau error message (1.59 KB, text/plain)
2004-08-04 23:25 UTC, Giovanni Bajo
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Giovanni Bajo 2004-08-04 23:20:03 UTC
The preprocessed source attacched with this report causes the following error 
message when compiled with 3.4:

/cygdrive/e/spirit/boost/spirit/phoenix/composite.hpp:281: error: return-stateme
nt with a value, in function returning 'void'

The error message is totally confusing, and has nothing to do with the real 
bug, which is a missing templated operator() (or so I am told, I have not 
analyzed it). I am also told the same error message appears with 3.3.

With Comeau, the error message is: "no instance of function template 
Test_Recipe_Grammar::lazy_attribute_filter_::operator() matches the argument 
list", which is the correct problem. The full error message can be seen here:
http://rafb.net/paste/results/IiYOX564.html.

This really needs a reduction to be properly analyzed.
Comment 1 Giovanni Bajo 2004-08-04 23:20:34 UTC
Created attachment 6883 [details]
Preprocessed source
Comment 2 Giovanni Bajo 2004-08-04 23:25:19 UTC
Created attachment 6884 [details]
Comeau error message

Attacching Comeau error message, since the link above is going to expire soon.
Comment 3 Andrew Pinski 2004-08-05 01:56:13 UTC
I get this error first:
pr16883.cc:50489: error: no match for call to `(Test_Recipe_Grammar::lazy_attribute_filter_) 
(__gnu_norm::map<uint32_t, std::pair<std::string, std::string>, std::less<uint32_t>, 
std::allocator<std::pair<const uint32_t, std::pair<std::string, std::string> > > >&, const 
std::pair<std::string, std::string>&)'
Comment 4 Andrew Pinski 2004-08-05 02:03:03 UTC
So it looks like the person is looking at the last error message rather than the first.

The reason for the error message which we output also comes from:
int f();
template <class T> T g(T *a){return f(a);}
void h(){g<void>(0);}

Which is correct because there is no f which has a return type of void. so closing as invalid.
Comment 5 Jacob Cohen 2004-08-05 03:05:34 UTC
Hi,

Rafb.Net's code pasting service is designed to automatically delete pasted code 
after 24 hours. I've extracted this particular paste into a more permanent URL:
http://www.rafb.net/gnu_16883.html

Regards,
Jake.(In reply to comment #0)
> http://rafb.net/paste/results/IiYOX564.html.