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

operator/ of std::chrono::duration and custom type #40475

Closed
llvmbot opened this issue Mar 18, 2019 · 7 comments
Closed

operator/ of std::chrono::duration and custom type #40475

llvmbot opened this issue Mar 18, 2019 · 7 comments
Assignees
Labels
bugzilla libc++

Comments

@llvmbot
Copy link
Collaborator

@llvmbot llvmbot commented Mar 18, 2019

Bugzilla Link 41130
Resolution FIXED
Resolved on Apr 01, 2019 09:39
Version unspecified
OS All
Attachments code to reproduce, patch by Howard Hinnant
Reporter LLVM Bugzilla Contributor
CC @mclow,@zoecarver

Extended Description

Defining an operator/ with a chrono::duration and a custom type fails to compile with libc++.

Example code attached
Problem description initially on https://stackoverflow.com/q/55167862/620382
Suggested patch by Howard Hinnant https://stackoverflow.com/a/55203313/620382

@llvmbot
Copy link
Collaborator Author

@llvmbot llvmbot commented Mar 18, 2019

assigned to @mclow

@mclow
Copy link
Contributor

@mclow mclow commented Mar 18, 2019

Nice patch, Howard. Needs more cowbell, though.
In particular, it needs to deal with operator%.
Working on it...

@mclow
Copy link
Contributor

@mclow mclow commented Mar 19, 2019

Howard's patch (when applied twice) fixes the problem; except on C++03.

@mclow
Copy link
Contributor

@mclow mclow commented Mar 20, 2019

Multiply has similar problems, too.

@zoecarver
Copy link
Contributor

@zoecarver zoecarver commented Mar 20, 2019

Are there tests for these operators?

@mclow
Copy link
Contributor

@mclow mclow commented Mar 20, 2019

Are there tests for these operators?

There are ... some.
I have added more as I investigate this bug.

@mclow
Copy link
Contributor

@mclow mclow commented Apr 1, 2019

Fixed in r357410.

@llvmbot llvmbot transferred this issue from llvm/llvm-bugzilla-archive Dec 10, 2021
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugzilla libc++
Projects
None yet
Development

No branches or pull requests

3 participants