volatile unknown in templates, egcs-1.1
Marc Lehmann
pcg@goof.com
Tue Sep 15 17:17:00 GMT 1998
With egcs-1.1, I can't compile this program:
template<typename a>
struct x
{
int y(a n) {
__asm__ __volatile__ ("");
}
};
int main()
{
x<int> a;
a.y(5);
}
cerebro:~# g++ -V1.1 -O6 -o x x.C
x.C: In method 'int x<int>::y<int>(int)':
x.C:13: instantiated from here
x.C:5: 'volatile' undeclared (first use this function)
x.C:5: (Each undeclared identifier is reported only once
x.C:5: for each function it appears in.)
x.C:5: warning: qualifier ignored on asm
asm volatile evokes the exact same message. for example, this means you
can't use ntohl in templates with glibc2 ;)
-----==- |
----==-- _ |
---==---(_)__ __ ____ __ Marc Lehmann +--
--==---/ / _ \/ // /\ \/ / pcg@goof.com |e|
-=====/_/_//_/\_,_/ /_/\_\ --+
The choice of a GNU generation |
|
More information about the Gcc-bugs
mailing list