Bug 1601907 Comment 0 Edit History

Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.

Building with clang trunk
```
 /var/lib/jenkins/workspace/firefox-clang-last/js/src/builtin/intl/NumberFormat.cpp:403:25: error: constexpr function never produces a constant expression [-Winvalid-constexpr]
 static constexpr size_t MaxUnitLength() {
                         ^
 /var/lib/jenkins/workspace/firefox-clang-last/js/src/builtin/intl/NumberFormat.cpp:408:31: note: non-constexpr function 'length' cannot be used in a constant expression
     length = std::max(length, std::char_traits<char>::length(unit.subtype));
                               ^
 /usr/bin/../lib/gcc/x86_64-linux-gnu/6.3.0/../../../../include/c++/6.3.0/bits/char_traits.h:266:7: note: declared here
       length(const char_type* __s)
       ^
 In file included from Unified_cpp_js_src5.cpp:2:
 /var/lib/jenkins/workspace/firefox-clang-last/js/src/builtin/intl/NumberFormat.cpp:419:18: error: variable-sized object may not be initialized
   char unitChars[MaxUnitLength() + 1] = {};
                  ^~~~~~~~~~~~~~~~~~~
 2 errors generated.
```

Maybe caused by the C++17 migration?
Building with clang trunk
```
 /var/lib/jenkins/workspace/firefox-clang-last/js/src/builtin/intl/NumberFormat.cpp:403:25: error: constexpr function never produces a constant expression [-Winvalid-constexpr]
 static constexpr size_t MaxUnitLength() {
                         ^
 /var/lib/jenkins/workspace/firefox-clang-last/js/src/builtin/intl/NumberFormat.cpp:408:31: note: non-constexpr function 'length' cannot be used in a constant expression
     length = std::max(length, std::char_traits<char>::length(unit.subtype));
                               ^
 /usr/bin/../lib/gcc/x86_64-linux-gnu/6.3.0/../../../../include/c++/6.3.0/bits/char_traits.h:266:7: note: declared here
       length(const char_type* __s)
       ^
 In file included from Unified_cpp_js_src5.cpp:2:
 /var/lib/jenkins/workspace/firefox-clang-last/js/src/builtin/intl/NumberFormat.cpp:419:18: error: variable-sized object may not be initialized
   char unitChars[MaxUnitLength() + 1] = {};
                  ^~~~~~~~~~~~~~~~~~~
 2 errors generated.
```

Maybe caused by the C++17 migration?
with clang version 10.0.0-+20191205115126+41eeded8043-1~exp1~20191205105719.1634

Back to Bug 1601907 Comment 0