This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

`volatile' undeclared in class/function template.



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



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]