http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22596
Jason Merrill changed:
What|Removed |Added
Status|UNCONFIRMED |RESOLVED
Resolution|
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22596
Jason Merrill changed:
What|Removed |Added
CC||jason at gcc dot gnu.org
--- Comment #8 f
--
What|Removed |Added
GCC target triplet|i686-pc-linux-gnu, powerpc- |
|apple-darwin8 |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22596
--- Additional Comments From bangerth at dealii dot org 2005-07-22 00:18
---
Oh, I apparently didn't read closely enough. I see the problem now.
For others -- take this:
-
template void f(T) {}
template void f(T) {}
template void f (int);
-
--- Additional Comments From phenning at lanl dot gov 2005-07-21 23:26
---
(In reply to comment #5)
> Your explicit instantiation
> template int foo< A_class >(A_class a);
> obviously matches both the declarations of foo. I'm unsure which
> one the compiler should choose, but if you
--- Additional Comments From bangerth at dealii dot org 2005-07-21 23:17
---
Your explicit instantiation
template int foo< A_class >(A_class a);
obviously matches both the declarations of foo. I'm unsure which
one the compiler should choose, but if you want to instantiate the
secon
--- Additional Comments From phenning at lanl dot gov 2005-07-21 19:16
---
(In reply to comment #2)
> void g(void)
> {
> A_class a;
> foo >(a);
> }
Right, and I think that it should in that case. It seems that g++ attempts to
call the first definition
when there is usage like:
--- Additional Comments From pinskia at gcc dot gnu dot org 2005-07-21
18:58 ---
I don't think this is a bug in the front-end.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22596
--- Additional Comments From pinskia at gcc dot gnu dot org 2005-07-21
18:57 ---
Note both Comeau and ICC have this same behavior.
Even the following code calls the second declaration too:
template struct A_class
{
int do_it(int i){return T::f(i);}
};
template int foo(A a);
template
--- Additional Comments From phenning at lanl dot gov 2005-07-21 18:48
---
Created an attachment (id=9324)
--> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=9324&action=view)
sample code illustrating problem
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22596
10 matches
Mail list logo