This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/14912] Do not print default template arguments in error messages
- From: "gdr at integrable-solutions dot net" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 26 Mar 2005 19:52:15 -0000
- Subject: [Bug c++/14912] Do not print default template arguments in error messages
- References: <20040410193158.14912.schnetter@aei.mpg.de>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From gdr at integrable-solutions dot net 2005-03-26 19:52 -------
Subject: Re: Do not print default template arguments in error messages
"giovannibajo at libero dot it" <gcc-bugzilla@gcc.gnu.org> writes:
| ------- Additional Comments From giovannibajo at libero dot it 2005-03-26 19:24 -------
| OK, before I clean up the patch, I'll post an example. For this code:
|
| ----------------------------------------------
| #include <map>
| #include <vector>
| #include <string>
|
| std::map<std::string, std::vector<int> > m;
|
| void bar(void)
| {
| std::vector<int> k;
| m.insert(std::make_pair(0, k));
| }
| ----------------------------------------------
|
| I get this:
|
| <path>/stl_pair.h: In constructor 'std::pair<_T1, _T2>::pair(const
| std::pair<_U1, _U2>&) [with _U1 = int, _U2 = std::vector<int>, _T1 = const
| std::string, _T2 = std::vector<int>]':
| test3.cc:10: instantiated from here
| <path>/stl_pair.h:90: error: invalid conversion from 'const int' to 'const
| char*'
| <path>/stl_pair.h:90: error: initializing argument 1
| of 'std::basic_string<_CharT, _Traits, _Alloc>::basic_string(const _CharT*,
| const _Alloc&) [with _CharT = char]'
|
| (I manually edited '<path>')
| Without my patch, I get this:
That is fair improvement. I realize we don't retain std::string in
the last diagnostic, but we don't need to do that before you check-in
your patch -- that is a whole project in itself.
-- Gaby
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14912