public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/26268] New: template function implicity instatiated
@ 2006-02-13 20:27 eduffy at gmail dot com
2006-02-13 20:27 ` [Bug c++/26268] " pinskia at gcc dot gnu dot org
0 siblings, 1 reply; 2+ messages in thread
From: eduffy at gmail dot com @ 2006-02-13 20:27 UTC (permalink / raw)
To: gcc-bugs
While compiling:
template<typename T>
struct Type2Type {
typedef T Type;
};
template<class T>
inline void foo(Type2Type<T> const&) {
int x = NOT_HERE;
}
int main(int, char *) {
// std::cout << "Hello world!" << std::endl;
}
g++ gives an error about NOT_HERE being declared. Rightly so, but the function
`foo' is never called or explicity instantiated, so `foo' should never be
compiled.
>From "14.7.1 Implicit instantiation" of the ISO C++ standard:
9. An implementation shall not implicitly instantiate a function template,
a member template, a non-virtual member function, a member class or a
static data member of a class template that does not require instantia-
tion.
--
Summary: template function implicity instatiated
Product: gcc
Version: 4.0.2
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: eduffy at gmail dot com
GCC host triplet: i686-pc-linux-gnu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26268
^ permalink raw reply [flat|nested] 2+ messages in thread
* [Bug c++/26268] template function implicity instatiated
2006-02-13 20:27 [Bug c++/26268] New: template function implicity instatiated eduffy at gmail dot com
@ 2006-02-13 20:27 ` pinskia at gcc dot gnu dot org
0 siblings, 0 replies; 2+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-02-13 20:27 UTC (permalink / raw)
To: gcc-bugs
------- Comment #1 from pinskia at gcc dot gnu dot org 2006-02-13 20:27 -------
*** This bug has been marked as a duplicate of 26267 ***
--
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution| |DUPLICATE
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26268
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2006-02-13 20:27 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-02-13 20:27 [Bug c++/26268] New: template function implicity instatiated eduffy at gmail dot com
2006-02-13 20:27 ` [Bug c++/26268] " pinskia at gcc dot gnu dot 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).