public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/54235] New: Templates compile but don't link
@ 2012-08-12 18:47 todor.milev at gmail dot com
2012-08-12 23:26 ` [Bug c++/54235] " daniel.kruegler at googlemail dot com
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: todor.milev at gmail dot com @ 2012-08-12 18:47 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54235
Bug #: 54235
Summary: Templates compile but don't link
Classification: Unclassified
Product: gcc
Version: 4.6.3
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: todor.milev@gmail.com
//This compiles but does not link on gcc 4.6.3, ubuntu 32 bit.
//Discussed at: http://www.cplusplus.com/forum/general/77046/#msg414427
//Compiles and links on other compilers/platforms.
//The code is a minified version from a real project.
//main.cpp
class Integer
{
public:
static unsigned int HashFunction(const Integer& input)
{ return 0;
}
};
template <class Object, unsigned int hashFunction(const
Object&)=Object::HashFunction>
class List
{
public:
inline unsigned int GetHash(const Object& input)const
{ return hashFunction(input);
}
};
template <class Object>
class ListSpecialized: public List<Object, Object::HashFunction>
{
};
template <class CoefficientType, unsigned int inputHashFunction(const
CoefficientType&)= CoefficientType::HashFunction>
class Element
{
public:
static inline unsigned int HashFunction(const Element<CoefficientType,
inputHashFunction>& input)
{ CoefficientType x;
return inputHashFunction(x);
}
};
template<class CoefficientType>
class TheComputation
{
public:
List<Element<Integer>, Element<Integer>::HashFunction >
//ListSpecialized<Element<Integer> >
theList;
};
int main()
{ TheComputation<Integer > A;
Element<Integer> x;
A.theList.GetHash(x);
return 0;
}
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug c++/54235] Templates compile but don't link
2012-08-12 18:47 [Bug c++/54235] New: Templates compile but don't link todor.milev at gmail dot com
@ 2012-08-12 23:26 ` daniel.kruegler at googlemail dot com
2012-08-26 0:05 ` redi at gcc dot gnu.org
2021-07-27 7:52 ` pinskia at gcc dot gnu.org
2 siblings, 0 replies; 4+ messages in thread
From: daniel.kruegler at googlemail dot com @ 2012-08-12 23:26 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54235
Daniel Krügler <daniel.kruegler at googlemail dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |daniel.kruegler at
| |googlemail dot com
--- Comment #1 from Daniel Krügler <daniel.kruegler at googlemail dot com> 2012-08-12 23:25:51 UTC ---
The problem still exists in gcc 4.8 trunk
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug c++/54235] Templates compile but don't link
2012-08-12 18:47 [Bug c++/54235] New: Templates compile but don't link todor.milev at gmail dot com
2012-08-12 23:26 ` [Bug c++/54235] " daniel.kruegler at googlemail dot com
@ 2012-08-26 0:05 ` redi at gcc dot gnu.org
2021-07-27 7:52 ` pinskia at gcc dot gnu.org
2 siblings, 0 replies; 4+ messages in thread
From: redi at gcc dot gnu.org @ 2012-08-26 0:05 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54235
Jonathan Wakely <redi at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Last reconfirmed| |2012-08-26
Ever Confirmed|0 |1
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug c++/54235] Templates compile but don't link
2012-08-12 18:47 [Bug c++/54235] New: Templates compile but don't link todor.milev at gmail dot com
2012-08-12 23:26 ` [Bug c++/54235] " daniel.kruegler at googlemail dot com
2012-08-26 0:05 ` redi at gcc dot gnu.org
@ 2021-07-27 7:52 ` pinskia at gcc dot gnu.org
2 siblings, 0 replies; 4+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-07-27 7:52 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=54235
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Resolution|--- |FIXED
Target Milestone|--- |8.0
Status|NEW |RESOLVED
--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Fixed in GCC 8.0.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2021-07-27 7:52 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-08-12 18:47 [Bug c++/54235] New: Templates compile but don't link todor.milev at gmail dot com
2012-08-12 23:26 ` [Bug c++/54235] " daniel.kruegler at googlemail dot com
2012-08-26 0:05 ` redi at gcc dot gnu.org
2021-07-27 7:52 ` pinskia at gcc dot gnu.org
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).