[libcxx] r337962 - Make <experimental/filesystem> compile with gcc 4.8.5

Eric Fiselier via cfe-commits cfe-commits at lists.llvm.org
Wed Jul 25 14:01:45 PDT 2018


Author: ericwf
Date: Wed Jul 25 14:01:45 2018
New Revision: 337962

URL: http://llvm.org/viewvc/llvm-project?rev=337962&view=rev
Log:
Make <experimental/filesystem> compile with gcc 4.8.5

Patch by Victor Zverovich.

This fixes an error when compiling `<experimental/filesystem>` with gcc 4.8.5:

```
.../libcxx/src/experimental/filesystem/filesystem_common.h:137:34:
error: redeclaration ‘T
std::experimental::filesystem::v1::detail::{anonymous}::error_value() [with T =
bool]’ d
iffers in ‘constexpr’
 constexpr bool error_value<bool>() {
                                  ^
.../libcxx/src/experimental/filesystem/filesystem_common.h:133:3:
error: from previous declaration ‘T
std::experimental::filesystem::v1::detail::{anonymous}::error_value() [with T
 = bool]’
 T error_value();
   ^
```

Reviewed as https://reviews.llvm.org/D49813

Modified:
    libcxx/trunk/src/experimental/filesystem/filesystem_common.h

Modified: libcxx/trunk/src/experimental/filesystem/filesystem_common.h
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/src/experimental/filesystem/filesystem_common.h?rev=337962&r1=337961&r2=337962&view=diff
==============================================================================
--- libcxx/trunk/src/experimental/filesystem/filesystem_common.h (original)
+++ libcxx/trunk/src/experimental/filesystem/filesystem_common.h Wed Jul 25 14:01:45 2018
@@ -118,11 +118,11 @@ T error_value();
 template <>
 _LIBCPP_CONSTEXPR_AFTER_CXX11 void error_value<void>() {}
 template <>
-constexpr bool error_value<bool>() {
+bool error_value<bool>() {
   return false;
 }
 template <>
-constexpr uintmax_t error_value<uintmax_t>() {
+uintmax_t error_value<uintmax_t>() {
   return uintmax_t(-1);
 }
 template <>




More information about the cfe-commits mailing list