I've been puzzled by found inconsistency in specifications and tried to make some research. My personal conclusion is that indeed, OpenGL specifications uses ambiguous/bad wording in this aspect, which has been introduced since OpenGL 3.2+ (the fragment quoted from OpenGL 4.2 Core was first introduced in OpenGL 3.2 Core and remained unchanged).
OpenGL 3.2 demands implementations to support only GLSL 1.40 (OpenGL 3.1) and GLSL 1.50 (OpenGL 3.2) and at the same time specifies that it is compatible with OpenGL 3.1 without removed deprecated functionality.
OpenGL 3.2 implementations are guaranteed to support versions 1.40 and 1.50 of the OpenGL Shading Language. All references to sections of that specification refer to version 1.50.
...
The core profile of OpenGL 4.6 is also guaranteed to support all previous versions of the OpenGL Shading Language back to version 1.40
...
The OpenGL 3.2 core profile is upward compatible with OpenGL 3.1, but not with earlier versions.
At the same time, OpenGL 3.0 and 3.1 explicitly marked GLSL 1.10 (OpenGL 2.0) and GLSL 1.20 (OpenGL 2.1) as deprecated (and removed in OpenGL 3.1):
OpenGL 3.1 implementations are guaranteed to support at least version 1.30 of the shading language.
...
The features deprecated in OpenGL 3.0: ... OpenGL Shading Language versions 1.10 and 1.20. These versions of the shading language depend on many API features that have also been deprecated.
But specs doesn't mention GLSL 1.30 (OpenGL 3.0) in deprecation context, so that there is no obvious reason to consider GLSL 1.30 being deprecated (as dedicated GLSL 1.30 specification itself elaborates deprecated functionality).
One may also note, that OpenGL 3.1 doesn't require GLSL 1.40 to be supported (although it was introduced by this specs)! So stating OpenGL 3.2 being "upward-compatible" to OpenGL 3.1 without GLSL 1.30 support (the only version mandatory to be supported by OpenGL 3.1 specs) looks at bare minimum confusing to me.
I guess that OpenGL specs authors in "upward-compatible" section implicitly referred to non-GLSL functionality, and designed dedicated section "implementations are guaranteed ... shading language" to clarify requirements upon GLSL versions, so that the latter dominates over the first one.
I've tried to check OpenGL implementations at hand to see what they will tell for different GLSL versions (110, 120, 130, 140, 150) within Core Profile, GLSL compilation warnings logged and Debug context enabled:
- NVIDIA (456.71), Intel and Mesa (20.2.6)
- GLSL 1.10+ - say not a word for any known GLSL versions;
- AMD
- GLSL 1.10/GLSL 1.20 - shader compiler generates a warning
WARNING: warning(#271) Explicit version number 120 not supported by GL3 forward compatible context;
- GLSL 1.30+ - no warnings;
- Apple (Metal 71.0.7)
- GLSL 1.10/1.20/1.30 - generates a shader compilation error
ERROR: 0:1: '' : version '130' is not supported
- GLSL 1.40+ - no issues.
So, it seems that OpenGL vendors are inconclusive on reading this portion of specifications.
NVIDIA just doesn't care (their GLSL -> Cg translator is known to skip most of GLSL validation), Intel too (but their OpenGL driver was never good), as well as Mesa. But this is NOT a violation of OpenGL specs, as they say that OpenGL implementations may support any other GLSL versions in addition to mandatory ones.
AMD is known to have a good GLSL validator, and apparrently their engineers read the portions of the spec stating "OpenGL 3.2 Core Profile should support the same as OpenGL 3.1 except deprecated functionality". But does it softly - without compilation errors, as only shader compilation log suggests that GLSL 1.20 should not be used (but GLSL 1.30 is OK!).
Apple is known to be paranoid in following OpenGL specs and usually generates errors on every deviation from it. And here we see that Apple engineers read the other portion of OpenGL 3.2 specification listing supported GLSL versions as 1.40 and 1.50 - so that it does not accept GLSL 1.30.
It should be noted, that most vendors implemented OpenGL 3.2 after implementing OpenGL 3.0 and 3.1, so that it is really not a big deal for them to support all GLSL versions starting from 1.10.
In contrast, Apple never has OpenGL 3.0/3.1 and implemented OpenGL 3.2 Core Profile straight ahead (without any interest in implementing Compatible Profiles). That's why, I guess, they preferred to read specs that GLSL 1.30 (OpenGL 3.1) is not supported.
The general wording in OpenGL specifications states that the range of supported GLSL versions may be wider and suggests querying GL_SHADING_LANGUAGE_VERSION, but apparently, this query is useless to retrieve a minimal GLSL version or complete list of supported versions, and no other API provided for that purpose. So that one may only "probe" shader compiler to see if particular version is supported or not (outside the list of mandatory ones).
From the other side, separate GLSL versioning independent from OpenGL looks redundant, as newer GLSL revisions are also compatible with earlier ones (save deprecated functionality) - so that there is no much reason to not force GLSL 4.20 while using OpenGL 4.2, as long as you are not just trying to verify GLSL compatibility with older OpenGL versions.
Practically speaking, OpenGL 3.2 and it's GLSL 1.50 looks like a more reasonable baseline for development, as I don't really know up-to-date implementations supporting OpenGL 3.1 but not OpenGL 3.2 Core Profile.