Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Building with clang c++17, wide chars #63

Closed
greenkalx opened this issue Apr 9, 2020 · 5 comments
Closed

Building with clang c++17, wide chars #63

greenkalx opened this issue Apr 9, 2020 · 5 comments
Assignees
Labels
available on master Fix is done on master branch, issue closed on next release bug Something isn't working
Milestone

Comments

@greenkalx
Copy link

greenkalx commented Apr 9, 2020

Describe the bug
Building in Visual Studio with the wide character flag: GHC_WIN_WSTRING_STRING_TYPE
With clang 11, and c++17, I have these warnings/errors:

1>In file included from D:\filesystem\test\filesystem_test.cpp:62: 1>D:\filesystem\include\ghc/filesystem.hpp(4509,50): error : suggest braces around initialization of subobject [-Werror,-Wmissing-braces] 1>D:\filesystem\include\ghc/filesystem.hpp(4510,42): error : suggest braces around initialization of subobject [-Werror,-Wmissing-braces] 1>D:\filesystem\include\ghc/filesystem.hpp(4511,46): error : suggest braces around initialization of subobject [-Werror,-Wmissing-braces] 1>D:\filesystem\include\ghc/filesystem.hpp(1649,13): error : no matching function for call to 'toUtf8' 1>D:\filesystem\include\ghc/filesystem.hpp(2628,29): message : in instantiation of function template specialization 'ghc::filesystem::path::path<std::basic_string_view<wchar_t, std::char_traits<wchar_t> >, ghc::filesystem::path>' requested here 1>D:\filesystem\include\ghc/filesystem.hpp(1536,20): message : candidate template ignored: could not match 'basic_string' against 'basic_string_view' 1>D:\filesystem\include\ghc/filesystem.hpp(1542,20): message : candidate template ignored: could not match 'basic_string' against 'basic_string_view' 1>D:\filesystem\include\ghc/filesystem.hpp(1571,20): message : candidate template ignored: could not match 'basic_string' against 'basic_string_view' 1>D:\filesystem\include\ghc/filesystem.hpp(1581,20): message : candidate template ignored: could not match 'const charT *' against 'std::basic_string_view<wchar_t, std::char_traits<wchar_t> >'

Please find my Visual Studio project file for filesystem_test attached. (just trim the .txt extension)

Note! clang compiles with only the first three warnings with c++11 (without the actual basic_string_view error)

To create the Visual Studio solution and projects, I ran:
cmake -G "Visual Studio 15 2017 Win64"

I am working with latest on master: commit 9a047b9

To Reproduce
Compile as above

Expected behavior
Compiles, no errors. Warnings are negotiable. :)

Additional context

Thank you for creating this library. I was working with the Windows filesystem, which I found did not support path appending as expected. And I want to have standard cross-platform support.

filesystem_test.vcxproj.txt

@gulrak gulrak self-assigned this Apr 9, 2020
@greenkalx
Copy link
Author

Small update.
I'm going to try sticking with c++11 instead of c++17 which I was mostly using just for std::filesystem.
But I found in my app, that I get the same error above with c++11.
Not with filesystem_test and c++11.

@gulrak
Copy link
Owner

gulrak commented Apr 9, 2020

Testing solutions on branch feature-63-windows-clang-issues.

gulrak added a commit that referenced this issue Apr 9, 2020
@gulrak
Copy link
Owner

gulrak commented Apr 9, 2020

Can you try the branch version? I don't have your configuration for testing, I tried with a combination of VS2019 and llvm 9, got those errors as well and fixed them there, so I guess it should work, but I just want to make sure it works for you.

@gulrak gulrak added this to the v1.3.4 milestone Apr 9, 2020
@gulrak gulrak added the bug Something isn't working label Apr 9, 2020
@greenkalx
Copy link
Author

Thank you, that's compiling!

@gulrak
Copy link
Owner

gulrak commented Apr 9, 2020

Good to hear, thanks for testing!

@gulrak gulrak closed this as completed in 3f1c185 Apr 10, 2020
@gulrak gulrak added the available on master Fix is done on master branch, issue closed on next release label Apr 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
available on master Fix is done on master branch, issue closed on next release bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants