Skip to content

Commit 26005c7

Browse files
committed
[libcxx] Make path::format a non-class enum
The spec doesn't declare it as an enum class, and being declared as an enum class breaks referring to the values as e.g. path::auto_format. Differential Revision: https://reviews.llvm.org/D97084
1 parent 6b286d9 commit 26005c7

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

libcxx/include/filesystem

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -921,7 +921,7 @@ public:
921921
typedef basic_string<value_type> string_type;
922922
typedef basic_string_view<value_type> __string_view;
923923

924-
enum class _LIBCPP_ENUM_VIS format : unsigned char {
924+
enum _LIBCPP_ENUM_VIS format : unsigned char {
925925
auto_format,
926926
native_format,
927927
generic_format

libcxx/test/std/input.output/filesystems/class.path/path.member/path.construct/source.pass.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,9 @@ void RunTestCase(MultiStringType const& MS) {
8787
RunTestCaseImpl<CharT>(MS, fs::path::format::auto_format);
8888
RunTestCaseImpl<CharT>(MS, fs::path::format::native_format);
8989
RunTestCaseImpl<CharT>(MS, fs::path::format::generic_format);
90+
RunTestCaseImpl<CharT>(MS, fs::path::auto_format);
91+
RunTestCaseImpl<CharT>(MS, fs::path::native_format);
92+
RunTestCaseImpl<CharT>(MS, fs::path::generic_format);
9093
}
9194

9295
void test_sfinae() {

libcxx/test/std/input.output/filesystems/fs.enum/enum.path.format.pass.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,7 @@ int main(int, char**) {
2323
typedef fs::path::format E;
2424
static_assert(std::is_enum<E>::value, "");
2525

26-
// Check that E is a scoped enum by checking for conversions.
2726
typedef std::underlying_type<E>::type UT;
28-
LIBCPP_STATIC_ASSERT(!std::is_convertible<E, UT>::value, "");
2927

3028
LIBCPP_ONLY(static_assert(std::is_same<UT, unsigned char>::value, "")); // Implementation detail
3129

0 commit comments

Comments
 (0)