It is a bit different actually:
ALT+G works correctly in both cases.
ALT+SHIFT+G works for the case with correct coloring, and does nothing for the wrong case.
Here is the full code, if it helps:
#include <vector>
#include <algorithm>
using namespace std;
void Print(const vector<double> &vect)
{
for (size_t i = 0; i < vect.size(); i++)
printf("%.0f ", vect[i]);
printf("\\n");
}
int main()
{
const int COUNT = 3;
vector<double> a(COUNT);
for (size_t i = 0; i < a.size(); i++)
a[i] = COUNT - i;
Print(a);
return 0;
}