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

Argument is missed in case chrono_literals #15

Closed
Kurkin opened this issue May 25, 2018 · 5 comments
Closed

Argument is missed in case chrono_literals #15

Kurkin opened this issue May 25, 2018 · 5 comments
Labels
bug Something isn't working

Comments

@Kurkin
Copy link

Kurkin commented May 25, 2018

#include <chrono>
#include <string>

int main()
{
    using namespace std::literals;
    std::chrono::seconds t = 10s;
}
#include <chrono>
#include <string>

int main()
{
    using namespace std::literals;
    std::chrono::seconds t = std::operator""s();
}
andreasfertig pushed a commit that referenced this issue May 25, 2018
Fixed #15: user defined literal with template argument.
@Kurkin
Copy link
Author

Kurkin commented May 25, 2018

Thanks for quick fix! Your tool is awesome!

@Kurkin
Copy link
Author

Kurkin commented May 25, 2018

Sorry, but as i can see test is failed and incorrect output generated

[FAILED] Issue15.cpp
32c32
<     std::chrono::seconds t = std::operator""s(98291919ull);
---
>     std::chrono::seconds t = std::operator""s<98291919>();

@andreasfertig andreasfertig added the bug Something isn't working label May 25, 2018
@andreasfertig
Copy link
Owner

Hi Kurkin,

I'm glad you like it.

Multiple things. Currently only the OS X tests count and should pass. The reason is, that libc++ and libstdc++ generate different results. As my main development happens under OS X I use that as a reference. The web front-end uses Docker and with that Linux. As far as I could see you reference the Linux build in the diff. Now the interesting thing seems to be that under Linux with libstdc++ it is in fact a template. So far it is correct. I'll have a separate look into why it does not compile.

@andreasfertig andreasfertig reopened this May 25, 2018
@Kurkin
Copy link
Author

Kurkin commented May 25, 2018

I guess with libstdc++ it should be

    std::chrono::seconds t = std::operator""s<'9','8','2','9','1','9','1','9'>();

https://godbolt.org/g/ndb2yd

@andreasfertig
Copy link
Owner

Thanks that's it! Patch is on its way.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants