/*

Following code compiled with clang-cl on win10 generates 2 errors
(while the same code compiled with MS cl compiles):

t1.cpp(12,35): error: in-class initializer for static data member is not a constant expression
        static const int64_t MIN_VALUE = -0x8000000000000000LL;
                                         ^~~~~~~~~~~~~~~~~~~~~
t1.cpp(15,39): error: in-class initializer for static data member is not a constant expression
    static const int64_t MIN_VALUE1 = -9223372036854775808LL;
                                      ^~~~~~~~~~~~~~~~~~~~~~
2 errors generated.

*/

#include <string>

static const int64_t MAX_VALUE = 0x7fffffffffffffffLL;
static const int64_t MIN_VALUE = -0x8000000000000000LL;

static const int64_t MAX_VALUE1 = 9223372036854775807LL;
static const int64_t MIN_VALUE1 = -9223372036854775808LL;


class X  {
    static const int64_t MAX_VALUE = 0x7fffffffffffffffLL;
    static const int64_t MIN_VALUE = -0x8000000000000000LL;

    static const int64_t MAX_VALUE1 = 9223372036854775807LL;
    static const int64_t MIN_VALUE1 = -9223372036854775808LL;
};


_______________________________________________
cfe-users mailing list
cfe-users@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-users

Reply via email to