[Bug c++/17413] [3.4/4.0 regression] local classes as template argument

gdr at cs dot tamu dot edu gcc-bugzilla@gcc.gnu.org
Tue Oct 12 09:55:00 GMT 2004


------- Additional Comments From gdr at cs dot tamu dot edu  2004-10-12 09:55 -------
Subject: Re:  [3.4/4.0 regression] local classes as template argument

"mmitchel at gcc dot gnu dot org" <gcc-bugzilla@gcc.gnu.org> writes:

| The bug here is that we are checking complain at all.
| 
| SFINAE does not say that when given a set of overload candidates you perform
| type deduction and then discard any candiates for which an any error occurs. 
| Instead, you perform type deduction and discard any candidates for which type
| deduction fails, which is a defined term in [temp.deduct].  Type
| deduction fails only under precise circumstances; using a local
| class as a template argument is not a case in which type deduction fails.

Absolutely.

| It looks like people have been throwing around "complain & tf_error"
| checks too freely in pt.c.

Amen.

| The question is then what happens after type deduction succeeds.
| Should we emit an error before doing overload resolution, or only if
| the invalid function is selected from the overload set?  DR 415 is a
| related issue and the proposed resolution suggests that errors about
| invalid substitutions may be issued before overload resolution.

My inclination is to emit the error only if the invalid function is
selected from the overload set.  I can see where DR 415 is heading,
and I think its general concern will no doubt be discussed in Redmond
or following as it affects large part of C++ evolution.

In the mean time, I would recommend we emit the error only if the
invalid function is selected.

-- Gaby


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17413



More information about the Gcc-bugs mailing list