* [Bug c++/17763] Wrong context in error message for template parameter
2004-10-01 2:10 [Bug c++/17763] New: Wrong context in error message for template parameter solodon at mail dot com
@ 2004-10-01 2:19 ` solodon at mail dot com
2004-10-01 3:20 ` pinskia at gcc dot gnu dot org
` (13 subsequent siblings)
14 siblings, 0 replies; 16+ messages in thread
From: solodon at mail dot com @ 2004-10-01 2:19 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From solodon at mail dot com 2004-10-01 02:19 -------
Created an attachment (id=7250)
--> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=7250&action=view)
Preprocessed file
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17763
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Bug c++/17763] Wrong context in error message for template parameter
2004-10-01 2:10 [Bug c++/17763] New: Wrong context in error message for template parameter solodon at mail dot com
2004-10-01 2:19 ` [Bug c++/17763] " solodon at mail dot com
@ 2004-10-01 3:20 ` pinskia at gcc dot gnu dot org
2004-10-01 3:30 ` solodon at mail dot com
` (12 subsequent siblings)
14 siblings, 0 replies; 16+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-10-01 3:20 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2004-10-01 03:20 -------
Invalid as template operator == (pair<T1,T2>&, pair<T1,T2>&) cannot not match pair<const X, Y> as
the first operand and pair<X, Y> as the second.
--
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution| |INVALID
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17763
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Bug c++/17763] Wrong context in error message for template parameter
2004-10-01 2:10 [Bug c++/17763] New: Wrong context in error message for template parameter solodon at mail dot com
2004-10-01 2:19 ` [Bug c++/17763] " solodon at mail dot com
2004-10-01 3:20 ` pinskia at gcc dot gnu dot org
@ 2004-10-01 3:30 ` solodon at mail dot com
2004-10-01 3:33 ` gdr at cs dot tamu dot edu
` (11 subsequent siblings)
14 siblings, 0 replies; 16+ messages in thread
From: solodon at mail dot com @ 2004-10-01 3:30 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From solodon at mail dot com 2004-10-01 03:30 -------
The question here is not about the fact that it doesn't match: I intentionally
made it so that it doesn't match to generate a compilation error, the problem
here is in what is reported in diagnostic message - that is incorrect.
--
What |Removed |Added
----------------------------------------------------------------------------
Status|RESOLVED |UNCONFIRMED
Resolution|INVALID |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17763
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Bug c++/17763] Wrong context in error message for template parameter
2004-10-01 2:10 [Bug c++/17763] New: Wrong context in error message for template parameter solodon at mail dot com
` (2 preceding siblings ...)
2004-10-01 3:30 ` solodon at mail dot com
@ 2004-10-01 3:33 ` gdr at cs dot tamu dot edu
2004-10-01 3:35 ` pinskia at gcc dot gnu dot org
` (10 subsequent siblings)
14 siblings, 0 replies; 16+ messages in thread
From: gdr at cs dot tamu dot edu @ 2004-10-01 3:33 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From gdr at cs dot tamu dot edu 2004-10-01 03:33 -------
Subject: Re: Wrong context in error message for template parameter
"pinskia at gcc dot gnu dot org" <gcc-bugzilla@gcc.gnu.org> writes:
| Invalid as template operator == (pair<T1,T2>&, pair<T1,T2>&) cannot
| not match pair<const X, Y> as the first operand and pair<X, Y> as
| the second.
I think you're being too hasty in closing this PR.
And I don't understand your point.
Could you elaborate?
-- Gaby
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17763
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Bug c++/17763] Wrong context in error message for template parameter
2004-10-01 2:10 [Bug c++/17763] New: Wrong context in error message for template parameter solodon at mail dot com
` (3 preceding siblings ...)
2004-10-01 3:33 ` gdr at cs dot tamu dot edu
@ 2004-10-01 3:35 ` pinskia at gcc dot gnu dot org
2004-10-01 3:41 ` gdr at cs dot tamu dot edu
` (9 subsequent siblings)
14 siblings, 0 replies; 16+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-10-01 3:35 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2004-10-01 03:35 -------
Well that line is correct as it is operator== which cannot be found.
we already fixed the problem:
t.cc:14: error: no match for 'operator==' in 'q. std::_Rb_tree_iterator<_Tp>::operator* [with _Tp = std::
pair<const int, int>]() == p'
for 4.0.0.
--
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution| |FIXED
Target Milestone|--- |4.0.0
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17763
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Bug c++/17763] Wrong context in error message for template parameter
2004-10-01 2:10 [Bug c++/17763] New: Wrong context in error message for template parameter solodon at mail dot com
` (4 preceding siblings ...)
2004-10-01 3:35 ` pinskia at gcc dot gnu dot org
@ 2004-10-01 3:41 ` gdr at cs dot tamu dot edu
2004-10-01 13:13 ` bangerth at dealii dot org
` (8 subsequent siblings)
14 siblings, 0 replies; 16+ messages in thread
From: gdr at cs dot tamu dot edu @ 2004-10-01 3:41 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From gdr at cs dot tamu dot edu 2004-10-01 03:41 -------
Subject: Re: Wrong context in error message for template parameter
"pinskia at gcc dot gnu dot org" <gcc-bugzilla@gcc.gnu.org> writes:
| Well that line is correct as it is operator== which cannot be found.
You miss the point of the report.
The issue is not that the operator cannot be found. The issue is
about the intelligibility of the diagnostic message.
| we already fixed the problem:
| t.cc:14: error: no match for 'operator==' in 'q. std::_Rb_tree_iterator<_Tp>::operator* [with _Tp = std::
| pair<const int, int>]() == p'
This is not what I consider fixing the problem. I am the one who
specifically put the new error message in 3.4.x (and therefore 4.0.x).
Please reopen this and put it in the category enhancement.'
-- Gaby
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17763
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Bug c++/17763] Wrong context in error message for template parameter
2004-10-01 2:10 [Bug c++/17763] New: Wrong context in error message for template parameter solodon at mail dot com
` (5 preceding siblings ...)
2004-10-01 3:41 ` gdr at cs dot tamu dot edu
@ 2004-10-01 13:13 ` bangerth at dealii dot org
2004-10-01 13:13 ` bangerth at dealii dot org
` (7 subsequent siblings)
14 siblings, 0 replies; 16+ messages in thread
From: bangerth at dealii dot org @ 2004-10-01 13:13 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From bangerth at dealii dot org 2004-10-01 13:12 -------
Confirmed. Take this smaller testcase:
----------------------
template <typename U> struct Outer {
struct Inner {};
Inner foo();
};
typedef int X;
typedef Outer<X> XOuter;
int main() {
Outer<int> ab;
ab.foo() == 1;
}
------------------------
Clearly, we make no use of the typedefs 'X' and 'XOuter', but we get this
error message:
g/x> /home/bangerth/bin/gcc-4.0-pre/bin/c++ -c x.cc
x.cc: In function `int main()':
x.cc:11: error: no match for 'operator==' in 'ab. Outer<U>::foo [with U = X]()
== 1'
The part of the error message in brackets should really read '[with U=int]',
rather than mention 'X'. Note that if I remove the 'XOuter' typedef, then
I do indeed get what I want.
W.
--
What |Removed |Added
----------------------------------------------------------------------------
Status|RESOLVED |UNCONFIRMED
Resolution|FIXED |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17763
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Bug c++/17763] Wrong context in error message for template parameter
2004-10-01 2:10 [Bug c++/17763] New: Wrong context in error message for template parameter solodon at mail dot com
` (6 preceding siblings ...)
2004-10-01 13:13 ` bangerth at dealii dot org
@ 2004-10-01 13:13 ` bangerth at dealii dot org
2004-10-01 13:15 ` bangerth at dealii dot org
` (6 subsequent siblings)
14 siblings, 0 replies; 16+ messages in thread
From: bangerth at dealii dot org @ 2004-10-01 13:13 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From bangerth at dealii dot org 2004-10-01 13:13 -------
.
--
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Ever Confirmed| |1
Last reconfirmed|0000-00-00 00:00:00 |2004-10-01 13:13:31
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17763
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Bug c++/17763] Wrong context in error message for template parameter
2004-10-01 2:10 [Bug c++/17763] New: Wrong context in error message for template parameter solodon at mail dot com
` (7 preceding siblings ...)
2004-10-01 13:13 ` bangerth at dealii dot org
@ 2004-10-01 13:15 ` bangerth at dealii dot org
2004-10-01 13:33 ` gdr at cs dot tamu dot edu
` (5 subsequent siblings)
14 siblings, 0 replies; 16+ messages in thread
From: bangerth at dealii dot org @ 2004-10-01 13:15 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From bangerth at dealii dot org 2004-10-01 13:15 -------
It is, btw, almost certainly related to PR 99, although there we have
instantiations rather than typedefs.
W.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17763
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Bug c++/17763] Wrong context in error message for template parameter
2004-10-01 2:10 [Bug c++/17763] New: Wrong context in error message for template parameter solodon at mail dot com
` (8 preceding siblings ...)
2004-10-01 13:15 ` bangerth at dealii dot org
@ 2004-10-01 13:33 ` gdr at cs dot tamu dot edu
2004-10-01 15:56 ` bangerth at dealii dot org
` (4 subsequent siblings)
14 siblings, 0 replies; 16+ messages in thread
From: gdr at cs dot tamu dot edu @ 2004-10-01 13:33 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From gdr at cs dot tamu dot edu 2004-10-01 13:33 -------
Subject: Re: Wrong context in error message for template parameter
"bangerth at dealii dot org" <gcc-bugzilla@gcc.gnu.org> writes:
| Confirmed. Take this smaller testcase:
| ----------------------
| template <typename U> struct Outer {
| struct Inner {};
| Inner foo();
| };
|
| typedef int X;
| typedef Outer<X> XOuter;
|
| int main() {
| Outer<int> ab;
| ab.foo() == 1;
| }
| ------------------------
| Clearly, we make no use of the typedefs 'X' and 'XOuter', but we get this
| error message:
|
| g/x> /home/bangerth/bin/gcc-4.0-pre/bin/c++ -c x.cc
| x.cc: In function `int main()':
| x.cc:11: error: no match for 'operator==' in 'ab. Outer<U>::foo [with U = X]()
| == 1'
|
| The part of the error message in brackets should really read '[with U=int]',
| rather than mention 'X'. Note that if I remove the 'XOuter' typedef, then
| I do indeed get what I want.
Thank you, Wolfgang! The diagnostic is also broken in that it is
printing something nonsensical
'ab. Outer<U>::foo [with U = X]() == 1'
That isn't C++.
Please could you assign this to me as enhancement?
I do not have plan to fix it in time for 4.0.0, though.
-- Gaby
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17763
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Bug c++/17763] Wrong context in error message for template parameter
2004-10-01 2:10 [Bug c++/17763] New: Wrong context in error message for template parameter solodon at mail dot com
` (9 preceding siblings ...)
2004-10-01 13:33 ` gdr at cs dot tamu dot edu
@ 2004-10-01 15:56 ` bangerth at dealii dot org
2004-10-01 15:57 ` bangerth at dealii dot org
` (3 subsequent siblings)
14 siblings, 0 replies; 16+ messages in thread
From: bangerth at dealii dot org @ 2004-10-01 15:56 UTC (permalink / raw)
To: gcc-bugs
--
What |Removed |Added
----------------------------------------------------------------------------
CC| |gdr at gcc dot gnu dot org
Severity|normal |enhancement
Target Milestone|4.0.0 |---
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17763
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Bug c++/17763] Wrong context in error message for template parameter
2004-10-01 2:10 [Bug c++/17763] New: Wrong context in error message for template parameter solodon at mail dot com
` (10 preceding siblings ...)
2004-10-01 15:56 ` bangerth at dealii dot org
@ 2004-10-01 15:57 ` bangerth at dealii dot org
2004-10-01 16:02 ` gdr at cs dot tamu dot edu
` (2 subsequent siblings)
14 siblings, 0 replies; 16+ messages in thread
From: bangerth at dealii dot org @ 2004-10-01 15:57 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From bangerth at dealii dot org 2004-10-01 15:57 -------
Done. With respect to the message
'ab. Outer<U>::foo [with U = X]() == 1'
you are right, of course:
- there shouldn't be any space after "ab."
- the demangler should probably list the template args after the entire
expression, though I suspect that this is going to be a major change...
W.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17763
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Bug c++/17763] Wrong context in error message for template parameter
2004-10-01 2:10 [Bug c++/17763] New: Wrong context in error message for template parameter solodon at mail dot com
` (11 preceding siblings ...)
2004-10-01 15:57 ` bangerth at dealii dot org
@ 2004-10-01 16:02 ` gdr at cs dot tamu dot edu
2005-08-08 22:10 ` [Bug c++/17763] [3.4/4.0/4.1 Regression] " pinskia at gcc dot gnu dot org
2005-09-27 16:22 ` mmitchel at gcc dot gnu dot org
14 siblings, 0 replies; 16+ messages in thread
From: gdr at cs dot tamu dot edu @ 2004-10-01 16:02 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From gdr at cs dot tamu dot edu 2004-10-01 16:01 -------
Subject: Re: Wrong context in error message for template parameter
"bangerth at dealii dot org" <gcc-bugzilla@gcc.gnu.org> writes:
| Done.
Thanks!
| With respect to the message
| 'ab. Outer<U>::foo [with U = X]() == 1'
| you are right, of course:
| - there shouldn't be any space after "ab."
| - the demangler should probably list the template args after the entire
| expression, though I suspect that this is going to be a major change...
That error is committed in cp/error.c:dump_function_decl().
-- Gaby
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17763
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Bug c++/17763] [3.4/4.0/4.1 Regression] Wrong context in error message for template parameter
2004-10-01 2:10 [Bug c++/17763] New: Wrong context in error message for template parameter solodon at mail dot com
` (12 preceding siblings ...)
2004-10-01 16:02 ` gdr at cs dot tamu dot edu
@ 2005-08-08 22:10 ` pinskia at gcc dot gnu dot org
2005-09-27 16:22 ` mmitchel at gcc dot gnu dot org
14 siblings, 0 replies; 16+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-08-08 22:10 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2005-08-08 22:10 -------
2.95.3 worked correctly:
earth:~>~/ia32_linux_gcc2_95/bin/gcc t.cc
t.cc: In function `int main()':
t.cc:12: no match for `Outer<int>::Inner == int'
This is very much related to PR 23293.
--
What |Removed |Added
----------------------------------------------------------------------------
OtherBugsDependingO| |23293
nThis| |
Severity|enhancement |minor
Known to work| |2.95
Summary|Wrong context in error |[3.4/4.0/4.1 Regression]
|message for template |Wrong context in error
|parameter |message for template
| |parameter
Target Milestone|--- |4.0.2
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17763
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Bug c++/17763] [3.4/4.0/4.1 Regression] Wrong context in error message for template parameter
2004-10-01 2:10 [Bug c++/17763] New: Wrong context in error message for template parameter solodon at mail dot com
` (13 preceding siblings ...)
2005-08-08 22:10 ` [Bug c++/17763] [3.4/4.0/4.1 Regression] " pinskia at gcc dot gnu dot org
@ 2005-09-27 16:22 ` mmitchel at gcc dot gnu dot org
14 siblings, 0 replies; 16+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2005-09-27 16:22 UTC (permalink / raw)
To: gcc-bugs
--
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|4.0.2 |4.0.3
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17763
^ permalink raw reply [flat|nested] 16+ messages in thread