\r
varying struct SSS { float f; } s; // ERROR\r
\r
+int vf(void);\r
+int vf2();\r
+int vf3(void v); // ERROR\r
+int vf4(int, void); // ERROR\r
+int vf5(int, void v); // ERROR\r
+\r
+void badswizzle()\r
+{\r
+ vec3 a[5];\r
+ a.y; // ERROR, no array swizzle\r
+ a.zy; // ERROR, no array swizzle\r
+ a.nothing; // ERROR\r
+ a.length(); // ERROR, not this version\r
+ a.method(); // ERROR\r
+}\r
+\r
uniform samplerExternalOES badExt; // syntax ERROR\r
ERROR: 0:170: 'multiple prototypes for same function' : not supported for this version or the enabled extensions \r
ERROR: 0:177: 'multiple prototypes for same function' : not supported for this version or the enabled extensions \r
ERROR: 0:179: 'fragment-shader struct input' : not supported for this version or the enabled extensions \r
-ERROR: 0:181: '' : syntax error\r
-ERROR: 62 compilation errors. No code generated.\r
+ERROR: 0:183: 'v' : illegal use of type 'void' \r
+ERROR: 0:184: 'void' : cannot be an argument type except for '(void)' \r
+ERROR: 0:185: 'v' : illegal use of type 'void' \r
+ERROR: 0:185: 'void' : cannot be an argument type except for '(void)' \r
+ERROR: 0:190: '.' : cannot apply to an array: y\r
+ERROR: 0:191: '.' : cannot apply to an array: zy\r
+ERROR: 0:192: '.' : cannot apply to an array: nothing\r
+ERROR: 0:193: '.length' : not supported for this version or the enabled extensions \r
+ERROR: 0:194: '.' : cannot apply to an array: method\r
+ERROR: 0:194: 'a' : can't use function syntax on variable \r
+ERROR: 0:197: '' : syntax error\r
+ERROR: 72 compilation errors. No code generated.\r
\r
\r
Shader version: 100\r
0:175 Branch: Return with expression\r
0:175 Constant:\r
0:175 2 (const int)\r
+0:187 Function Definition: badswizzle( (void)\r
+0:187 Function Parameters: \r
+0:? Sequence\r
+0:190 'a' (5-element array of mediump 3-component vector of float)\r
+0:191 'a' (5-element array of mediump 3-component vector of float)\r
+0:192 'a' (5-element array of mediump 3-component vector of float)\r
+0:193 Constant:\r
+0:193 5 (const int)\r
+0:194 Constant:\r
+0:194 0.000000\r
0:? Linker Objects\r
0:? 'a' (3-element array of mediump int)\r
0:? 'uint' (mediump int)\r
0:175 Branch: Return with expression\r
0:175 Constant:\r
0:175 2 (const int)\r
+0:187 Function Definition: badswizzle( (void)\r
+0:187 Function Parameters: \r
+0:? Sequence\r
+0:190 'a' (5-element array of mediump 3-component vector of float)\r
+0:191 'a' (5-element array of mediump 3-component vector of float)\r
+0:192 'a' (5-element array of mediump 3-component vector of float)\r
+0:193 Constant:\r
+0:193 5 (const int)\r
+0:194 Constant:\r
+0:194 0.000000\r
0:? Linker Objects\r
0:? 'a' (3-element array of mediump int)\r
0:? 'uint' (mediump int)\r
ERROR: 0:28: 'length' : array must be declared with a size before using this method\r
ERROR: 0:31: 'length' : incomplete method syntax \r
ERROR: 0:32: 'length' : method does not accept any arguments \r
-ERROR: 0:33: 'flizbit' : does not apply to this type: 7-element array of float\r
+ERROR: 0:33: '.' : cannot apply to an array: flizbit\r
ERROR: 0:33: '=' : cannot convert from '7-element array of float' to 'int'\r
-ERROR: 0:34: 'flizbit' : does not apply to this type: 7-element array of float\r
+ERROR: 0:34: '.' : cannot apply to an array: flizbit\r
ERROR: 0:34: 'f' : can't use function syntax on variable \r
ERROR: 0:34: 'a4' : redefinition \r
ERROR: 0:35: 'arrays of arrays' : not supported with this profile: none\r
return intermediate.addMethod(base, TType(EbtInt), &field, loc);
}
+ // It's not .length() if we get to here.
+
+ if (base->isArray()) {
+ error(loc, "cannot apply to an array:", ".", field.c_str());
+
+ return base;
+ }
+
+ // It's neither an array nor .length() if we get here,
+ // leaving swizzles and struct/block dereferences.
+
TIntermTyped* result = base;
if (base->isVector() || base->isScalar()) {
if (base->isScalar()) {