Undefined reference to static constexpr char[]

前端 未结 6 1633
甜味超标
甜味超标 2020-11-22 08:06

I want to have a static const char array in my class. GCC complained and told me I should use constexpr, although now it\'s telling me

6条回答
  •  北荒
    北荒 (楼主)
    2020-11-22 08:34

    On my environment, gcc vesion is 5.4.0. Adding "-O2" can fix this compilation error. It seems gcc can handle this case when asking for optimization.

提交回复
热议问题