This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/17413] [3.4/4.0 regression] local classes as template argument
- From: "bangerth at dealii dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 12 Sep 2004 22:54:44 -0000
- Subject: [Bug c++/17413] [3.4/4.0 regression] local classes as template argument
- References: <20040911043255.17413.gdr@gcc.gnu.org>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From bangerth at dealii dot org 2004-09-12 22:54 -------
This is related to the substitution-failure-is-not-an-error thingy: we
realize that a local class cannot be matched against a template argument,
so we drop the template function std::for_each from the overload list --
and end up with an empty list, thus the error message.
We probably need to special-case the overload resolution process to handle
this case: when we end up with an empty overload list but there is a
function that would match were it not for a local class, we should report
so. Whether this kind of special-casing is desirable is another matter.
Reduced testcase is this:
-------------------
template <typename T> void foo() {};
int main () {
struct S {};
foo<S> ();
}
-----------------
g/x> /home/bangerth/bin/gcc-3.3.4-pre/bin/c++ -c x.cc
x.cc: In function `int main()':
x.cc:5: error: template-argument `main()::S' uses local type `main()::S'
x.cc:5: error: no matching function for call to `foo()'
g/x>
g/x> /home/bangerth/bin/gcc-3.4-pre/bin/c++ -c x.cc
x.cc: In function `int main()':
x.cc:5: error: no matching function for call to `foo()'
g/x>
g/x> /home/bangerth/bin/gcc-3.5-pre/bin/c++ -c x.cc
x.cc: In function `int main()':
x.cc:5: error: no matching function for call to `foo()'
W.
--
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Ever Confirmed| |1
Keywords| |diagnostic
Known to fail| |3.4.2 4.0.0
Known to work| |3.3.4
Last reconfirmed|0000-00-00 00:00:00 |2004-09-12 22:54:43
date| |
Summary|diagnostic regression for |[3.4/4.0 regression] local
|local classes as template |classes as template argument
|argument |
Target Milestone|--- |3.4.3
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17413