Nope, in my second example I keep using the same static const float. It's initialized inside the class and used very well inside the later code, but not in function qMax. I am already beginning to suspect that the error occurs because qMax() takes its arguments by reference (not value). Something wrong, when passing address of a static constant to a function.

Here is the same example 2, but at its full glory. It works, no error here:

Qt Code:
  1. class Test
  2. {
  3. public:
  4. static const float KValue=3.0;
  5. Test();
  6. };
  7.  
  8. Test::Test()
  9. {
  10. // Can be any function, not only a constructor
  11. float foo = 1.0;
  12. const float value = KValue; // Make a copy of the static constant
  13. foo = qMax( foo, value );
  14. }
  15.  
  16. int main()
  17. {
  18. // somewhere in a program
  19. Test obj;
  20. }
To copy to clipboard, switch view to plain text mode 

I've also noticed the following facts:
* Changing from float to int doesn't change the situation a bit.
* Using "normal" functions that take arguments by value (not by reference) doesn't lead to the error. Such functions can easily take static constants as arguments.