GLSL spec section 4.3.2 says "Initializers for const declarations must be constant expressions".
Apparently below 2 examples are not constant expressions, so should not be allowed:
const vec3 v = vec3(1.0, func()); // user defined functions do not return const value
float f = 1.0;
const vec4 v2 = vec4(float(vec4(1,2,3,f))); // f is not constant
And below example is not allowed in GLSL v1.10, but allowed starting from GLSL v1.20 (allowing built-in function call whose arguments are all constant expressions):
const vec4 v = vec4(normalize(vec4(1))); // builtIn functions do not return const
const vec4 v1 = vec4(clamp(1.0, .20, 3.0)); // builtIn functions do not return const
All of above examples are allowed in current mesa.
Fixed with glsl2 merge
verified with mesa master d442a01ac14382d83cdaac87d2832315ceb3e963.