[macstl-dev] gcc 3.3 on YellowDogLinux
Michael LeBlanc
leblanc at skycomputers.com
Fri Mar 25 23:28:15 WST 2005
> Now we're getting somewhere, at least we know mainline gcc borks when
> typedef'ing a __vector type within a C++ scope (class scope). Need to
> test whether this is OK for a namespace that surrounds the struct
> generator, since I'd rather the typedef be hidden in stdext::impl.
This works.
1 #include <altivec.h>
2
3 namespace mike
4 {
5 typedef __vector unsigned int VUT;
6 typedef __vector unsigned char VUC;
7
8 template <unsigned int v0> struct generator
9 {
10 VUT
11 operator() () const
12 {
13 union union_type
14 {
15 unsigned int val [4];
16 __vector unsigned int vec;
17 };
18 static const union_type un = {v0, v0, v0, v0};
19 return un.vec;
20 }
21 };
22 }
23
24 __vector unsigned char zz =
25 mike::VUC
26 (mike::generator <0> () ())
27 ;
But *sigh* see line 25. If I wrap () around the type, I get
gcc -c y2.cpp
y2.cpp:27: error: parse error before `;' token
> Perhaps, but just plain VUC is a syntax error since it's not a cast.
> You need to cast with (VUC).
You and I know that, but gcc is doing something like a cast. Or a
constructor?
More information about the macstl-dev
mailing list