This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
`volatile' undeclared in class/function template.
- To: gcc-bugs at gcc dot gnu dot org
- Subject: `volatile' undeclared in class/function template.
- From: Jose Gomes <Jose dot Gomes at sophia dot inria dot fr>
- Date: Fri, 15 Oct 1999 09:36:23 +0200
Hello,
the following code generates a compile time error:
template <class T>
void f() {
asm volatile ("");
}
int main() {
f<char>();
}
This error occurs when using the macro FD_ZERO in
a class/function template.
atlantis-22% g++ -v toto.C
Reading specs from
/usr/local/gcc/lib/gcc-lib/sparc-sun-solaris2.6/2.95.1/specs
gcc version 2.95.1 19990816 (release)
atlantis-24% g++ toto.C
toto.C: In function `void f<char>()':
toto.C:8: instantiated from here
toto.C:4: `volatile' undeclared (first use this function)
toto.C:4: (Each undeclared identifier is reported only once
toto.C:4: for each function it appears in.)
toto.C:4: confused by earlier errors, bailing out
Best regards,
Jose Gomes
--
Jose.Gomes@sophia.inria.fr Tel. +33 4 92 38 76 48
http://www.inria.fr/robotvis/personnel/jgomes
Projet RobotVis, INRIA, 2004, route des Lucioles - B.P. 93
F-06902 Sophia Antipolis Cedex, FRANCE