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

[support.srcloc] It's underspecified whether copy/move functions of source_location are constexpr or not #3170

Closed
frederick-vs-ja opened this issue Aug 12, 2019 · 4 comments · Fixed by #3309
Assignees

Comments

@frederick-vs-ja
Copy link
Contributor

Since the actual data members of std::source_location are not precisely specified, leaving these special member functions (copy/move constructor and copy/move assignment operator) implicitly declared might be insufficient to make them usable in constant evaluation.

I think it might be better to specify them as constexpr, either in the synopsis or in [source_location.syn]/3.

@frederick-vs-ja frederick-vs-ja changed the title [support.srcloc] It's underspecified whether copy/move functions of source_location are constexpr [support.srcloc] It's underspecified whether copy/move functions of source_location are constexpr or not Aug 12, 2019
@frederick-vs-ja
Copy link
Contributor Author

Or can we just specify that std::source_location is a trivially copyable type?
An implementation of std::experimental::source_location by gcc libstdc++ (which is the only implementation I can find) is already trivially copyable.

@jensmaurer jensmaurer added the lwg Issue must be reviewed by LWG. label Sep 5, 2019
@jensmaurer
Copy link
Member

Sounds like a LWG issue to me.

@jensmaurer
Copy link
Member

Submitted to lwgchair.

@jensmaurer
Copy link
Member

jensmaurer commented Oct 12, 2019

According to www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1208r6.pdf, it is intentionally unspecified (by absence) whether these functions are trivially copyable. We could assume the same applies to "constexpr". Let's add a note highlighting the "unspecified" fact.

@jensmaurer jensmaurer removed the lwg Issue must be reviewed by LWG. label Oct 12, 2019
@jensmaurer jensmaurer self-assigned this Oct 20, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants