* [Bug c++/50828] class template parameter not printed for member function template in candidate list
2011-10-22 13:20 [Bug c++/50828] New: class template parameter not printed for member function template in candidate list redi at gcc dot gnu.org
@ 2011-10-22 13:29 ` redi at gcc dot gnu.org
2011-10-22 21:40 ` paolo.carlini at oracle dot com
` (5 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: redi at gcc dot gnu.org @ 2011-10-22 13:29 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50828
--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> 2011-10-22 13:29:19 UTC ---
I noticed this while analysing PR 42356, the missing template argument makes it
much harder to see why name lookup results are ambiguous
template<typename T>
struct A {
template<typename U>
void f() { }
};
struct B : A<int>, A<void> { };
int main() {
B a;
a.f();
}
f.C: In function ‘int main()’:
f.C:11:5: error: request for member ‘f’ is ambiguous
f.C:4:12: error: candidates are: template<class U> void A::f() [with U = U, T =
void]
f.C:4:12: error: template<class U> void A::f() [with U = U, T =
int]
Because T isn't shown in the signature it's not immediately obvious that name
lookup found A<void>::f and A<int>::f in different base classes.
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug c++/50828] class template parameter not printed for member function template in candidate list
2011-10-22 13:20 [Bug c++/50828] New: class template parameter not printed for member function template in candidate list redi at gcc dot gnu.org
2011-10-22 13:29 ` [Bug c++/50828] " redi at gcc dot gnu.org
@ 2011-10-22 21:40 ` paolo.carlini at oracle dot com
2011-10-22 22:01 ` redi at gcc dot gnu.org
` (4 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: paolo.carlini at oracle dot com @ 2011-10-22 21:40 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50828
--- Comment #2 from Paolo Carlini <paolo.carlini at oracle dot com> 2011-10-22 21:39:49 UTC ---
Seems due to the below, ie, no decoration for a primary. Remains to be seen if
in other contexts (in this case the call chain is dump_template_decl ->
dump_function_decl -> dump_type -> dump_aggr_type -> dump_template_parms) we
actually do *not* want decorations, otherwise seems easy to change.
/////////////////
/* Dump the template parameters from the template info INFO under control of
FLAGS. PRIMARY indicates whether this is a primary template decl, or
specialization (partial or complete). For partial specializations we show
the specialized parameter values. For a primary template we show no
decoration. */
static void
dump_template_parms (tree info, int primary, int flags)
{
tree args = info ? TI_ARGS (info) : NULL_TREE;
if (primary && flags & TFF_TEMPLATE_NAME)
return;
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug c++/50828] class template parameter not printed for member function template in candidate list
2011-10-22 13:20 [Bug c++/50828] New: class template parameter not printed for member function template in candidate list redi at gcc dot gnu.org
2011-10-22 13:29 ` [Bug c++/50828] " redi at gcc dot gnu.org
2011-10-22 21:40 ` paolo.carlini at oracle dot com
@ 2011-10-22 22:01 ` redi at gcc dot gnu.org
2011-10-22 23:39 ` paolo.carlini at oracle dot com
` (3 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: redi at gcc dot gnu.org @ 2011-10-22 22:01 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50828
--- Comment #3 from Jonathan Wakely <redi at gcc dot gnu.org> 2011-10-22 22:01:12 UTC ---
Changing it would be consistent with the output for non-template member
functions of class templates:
template<typename T>
struct A {
void f() { }
};
int main() {
A<void> a;
a.f(0);
}
t.C: In function ‘int main()’:
t.C:8:8: error: no matching function for call to ‘A<void>::f(int)’
t.C:8:8: note: candidate is:
t.C:3:10: note: void A<T>::f() [with T = void]
t.C:3:10: note: candidate expects 0 arguments, 1 provided
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug c++/50828] class template parameter not printed for member function template in candidate list
2011-10-22 13:20 [Bug c++/50828] New: class template parameter not printed for member function template in candidate list redi at gcc dot gnu.org
` (2 preceding siblings ...)
2011-10-22 22:01 ` redi at gcc dot gnu.org
@ 2011-10-22 23:39 ` paolo.carlini at oracle dot com
2011-10-23 19:14 ` paolo.carlini at oracle dot com
` (2 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: paolo.carlini at oracle dot com @ 2011-10-22 23:39 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50828
--- Comment #4 from Paolo Carlini <paolo.carlini at oracle dot com> 2011-10-22 23:39:06 UTC ---
Indeed.
The difference between the two is in flags (primary is true for both of
course): due to the '| TFF_TEMPLATE_NAME' # error.c:1214 in dump_template_decl.
The fact is, toward the end of dump_template_decl there are quite a few of '|
TFF_TEMPLATE_NAME' and before trying removing one we should make sense of the
others.
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug c++/50828] class template parameter not printed for member function template in candidate list
2011-10-22 13:20 [Bug c++/50828] New: class template parameter not printed for member function template in candidate list redi at gcc dot gnu.org
` (3 preceding siblings ...)
2011-10-22 23:39 ` paolo.carlini at oracle dot com
@ 2011-10-23 19:14 ` paolo.carlini at oracle dot com
2012-09-24 16:57 ` paolo at gcc dot gnu.org
2012-09-24 16:59 ` paolo.carlini at oracle dot com
6 siblings, 0 replies; 8+ messages in thread
From: paolo.carlini at oracle dot com @ 2011-10-23 19:14 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50828
Paolo Carlini <paolo.carlini at oracle dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |ASSIGNED
Last reconfirmed| |2011-10-23
AssignedTo|unassigned at gcc dot |paolo.carlini at oracle dot
|gnu.org |com
Ever Confirmed|0 |1
--- Comment #5 from Paolo Carlini <paolo.carlini at oracle dot com> 2011-10-23 19:13:51 UTC ---
Looking into it.
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug c++/50828] class template parameter not printed for member function template in candidate list
2011-10-22 13:20 [Bug c++/50828] New: class template parameter not printed for member function template in candidate list redi at gcc dot gnu.org
` (4 preceding siblings ...)
2011-10-23 19:14 ` paolo.carlini at oracle dot com
@ 2012-09-24 16:57 ` paolo at gcc dot gnu.org
2012-09-24 16:59 ` paolo.carlini at oracle dot com
6 siblings, 0 replies; 8+ messages in thread
From: paolo at gcc dot gnu.org @ 2012-09-24 16:57 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50828
--- Comment #6 from paolo at gcc dot gnu.org <paolo at gcc dot gnu.org> 2012-09-24 16:56:52 UTC ---
Author: paolo
Date: Mon Sep 24 16:56:41 2012
New Revision: 191673
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=191673
Log:
2012-09-24 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/50828
* error.c (dump_function_decl): Strip TFF_TEMPLATE_NAME from flags
at the outset.
Modified:
trunk/gcc/cp/ChangeLog
trunk/gcc/cp/error.c
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug c++/50828] class template parameter not printed for member function template in candidate list
2011-10-22 13:20 [Bug c++/50828] New: class template parameter not printed for member function template in candidate list redi at gcc dot gnu.org
` (5 preceding siblings ...)
2012-09-24 16:57 ` paolo at gcc dot gnu.org
@ 2012-09-24 16:59 ` paolo.carlini at oracle dot com
6 siblings, 0 replies; 8+ messages in thread
From: paolo.carlini at oracle dot com @ 2012-09-24 16:59 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50828
Paolo Carlini <paolo.carlini at oracle dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution| |FIXED
Target Milestone|--- |4.8.0
--- Comment #7 from Paolo Carlini <paolo.carlini at oracle dot com> 2012-09-24 16:58:40 UTC ---
Fixed.
^ permalink raw reply [flat|nested] 8+ messages in thread