Fragment Shader compiling unsuccessfully - GLSL

This morning I decided to get to work studying shaders in the context of multiple light sources, and I notice that for some reason I cannot create a vec4 using a defined vec3 object as I was previously able to. I omitted all the code from one of my fragment shader files and notice that regardless of the name given to a variable the variable cannot be used to create a vec4 object. Is there something wrong with the code here that I do not see?:

#version 330 core

out vec4 frag_color;

in vec3 frag_pos;
in vec3 normal;
in vec2 tex_coords;


void main()
{
	vec3 result(1.0f, 1.0f, 0.5f);
	frag_color = vec4(result, 1.0f);
}

If I define frag_color as vec4(1.0f, 1.0f, 0.5f, 1.0f) the program runs fine with no report of a fragment shader compiling unsuccessfully. I do not recall these semantics being a problem previously, it seems that only this morning after finishing writing the shader the program complains about unsuccessful fragment shader compilation. Everything else is running smoothly and without issue.

In fact, even declaring a vec3 object prevents the shader from compiling, I see.

EDIT: The issue was solved by writing vec3 test = vec3(1.0f, 1.0f, 0.5f). Is this normal behavior for OpenGL?

This is C++ initialiser syntax. It isn’t supported by GLSL. It’s possible that some implementations might support it as an extension.

Hard-coding a value may result in the rest of the function body being discarded due to dead code elimination. This may hide some types of errors.

Thank you. After some looking over of the code I assumed it to be a C syntax error (which correlates to GLSL). All is well now.