Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[lib] Drop 'inline' from 'inline constexpr' variable templates.#4625

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Closed
jensmaurer wants to merge1 commit intocplusplus:mainfromjensmaurer:c15

Conversation

jensmaurer
Copy link
Member

SinceCWG2387, constexpr variable templates have external linkage.

Fixes#4601

@zygoloid, since const(expr) variable templates now have external linkage, it seems the "inline" is now redundant. What do you think?

@jensmaurerjensmaurerforce-pushed thec15 branch 2 times, most recently fromc32d513 to2971a3dCompareJune 5, 2021 17:07
@jensmaurerjensmaurer marked this pull request as ready for reviewJune 5, 2021 17:07
@jensmaurer
Copy link
MemberAuthor

@timsong-cpp , should be much better now.

@wg21botwg21bot added the needs rebaseThe pull request needs a git rebase to resolve merge conflicts. labelJun 17, 2021
@jensmaurerjensmaurer removed the needs rebaseThe pull request needs a git rebase to resolve merge conflicts. labelJun 17, 2021
@zygoloid
Copy link
Member

zygoloid commentedJun 17, 2021
edited
Loading

@zygoloid, since const(expr) variable templates now have external linkage, it seems the "inline" is now redundant. What do you think?

I agree that removinginline fromconstexpr variable templates is a correct change. However, if I remember correctly, the LWG folks were informed that theinline is redundant for variable templates (and it was -- arguably -- redundant beforeCWG2387 too, albeit for a different reason), but they wanted to keep it anyway. Seems worth checking with them.

In passing, I did a pass through the wording to double-check thatinline has no other semantic effect, and I found a bug that might be construed as causing problems with this change; here it is with suggested fix:

[module.import]/6: "A header unit shall not contain a definition of a non-inlinenon-template function or variable whose name has external linkage."

I'm not sure whether we'd consider that editorial, but the intent of the rule is that it only applies to declarations that allow at most one definition.

@tkoeppe
Copy link
Contributor

However, if I remember correctly, the LWG folks were informed that the inline is redundant for variable templates (and it was -- arguably -- redundant before CWG2387 too, albeit for a different reason), but they wanted to keep it anyway. Seems worth checking with them.

Thank you, that's good to know!@jwakely,@CaseyCarter: woudl you happen to have any immediate thoughts on whether the proposed change would be desirable by LWG, or perhaps on the contrary?

@tkoeppetkoeppe added decision-requiredA decision of the editorial group (or the Project Editor) is required. lwgIssue must be reviewed by LWG. labelsJun 17, 2021
@CaseyCarter
Copy link
Contributor

IIRC we were uncomfortable with "arguably redundant beforeCWG2387" and decided to keep the possibly-redundantinlines until such time as they became unarguably extraneous. I believe that is now the case.

While it wasn't an explicit discussion, I did recently mention this PR on the reflector (https://lists.isocpp.org/lib/2021/06/19716.php) as an argument to avoid adding another redundantinline in an LWG issue resolution, and there was no hue and cry.

@jwakely
Copy link
Member

until such time as they became unarguably extraneous

Yes, that was my understanding. "It's probably redundant, but there's an active core issue" wasn't very reassuring 🙂

@jensmaurer
Copy link
MemberAuthor

Editorial meeting 2021-06-18: This is pending the [module.import] fix mentioned by@zygoloid.

@jensmaurerjensmaurer added changes requestedChanges to the wording or approach have been requested and not yet applied. and removed decision-requiredA decision of the editorial group (or the Project Editor) is required. lwgIssue must be reviewed by LWG. labelsJun 18, 2021
@wg21botwg21bot added the needs rebaseThe pull request needs a git rebase to resolve merge conflicts. labelJun 20, 2021
@jensmaurerjensmaurer removed the needs rebaseThe pull request needs a git rebase to resolve merge conflicts. labelJul 4, 2021
@wg21botwg21bot added the needs rebaseThe pull request needs a git rebase to resolve merge conflicts. labelJan 19, 2022
@jensmaurerjensmaurer removed the needs rebaseThe pull request needs a git rebase to resolve merge conflicts. labelJan 19, 2022
@wg21botwg21bot added the needs rebaseThe pull request needs a git rebase to resolve merge conflicts. labelFeb 21, 2022
@jensmaurerjensmaurer removed the needs rebaseThe pull request needs a git rebase to resolve merge conflicts. labelDec 16, 2022
@jensmaurerjensmaurer removed their assignmentDec 16, 2022
@jensmaurer
Copy link
MemberAuthor

@CaseyCarter , please take a look.

@tkoeppe , rebased.

@tkoeppe
Copy link
Contributor

Thanks!

Copy link
Contributor

@CaseyCarterCaseyCarter left a comment
edited
Loading

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Everything I see here is good, but I think we're missing:

  • exposition-onlyis-vector-bool-reference incontainers.tex (2 places).
  • ranges::enable_view andranges::enable_borrowed_range partial specializations forspan incontainers.tex.
  • disable_sized_sentinel_for partial spec formove_iterator initerators.tex
  • uses_allocator_v primary inmemory.tex
  • Everything inmeta.tex?
  • ranges::enable_borrowed_range partials forempty_view,owning_view,as_rvalue_view,reverse_view,zip_view,adjacent_view,chunk_view,slide_view inranges.tex
  • views::istream primary inranges.tex
  • is_bind_expression_v,is_placeholder_v,is_execution_policy_v primary inutilities.tex

@jensmaurer
Copy link
MemberAuthor

@CaseyCarter , thanks, fixed.

Copy link
Contributor

@CaseyCarterCaseyCarter left a comment
edited
Loading

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Awesome! Thanks, Jens. One little indentation nit.

@tkoeppe
Copy link
Contributor

All good, all done?

CaseyCarter reacted with thumbs up emoji

Since CWG2387, constexpr variable templates have external linkage.
@jensmaurer
Copy link
MemberAuthor

jensmaurer commentedDec 18, 2022
edited
Loading

Applied with commit9ac5555

@tkoeppe
Copy link
Contributor

(I don't understand why this wasn't closed as "merged" when I rebase-squashed it. I thought it might have been a bug in GitHub.)

JohelEGP referenced this pull requestFeb 21, 2023
SinceCWG2387, constexpr variable templates have external linkage.
burblebee added a commit that referenced this pull requestFeb 22, 2023
burblebee added a commit that referenced this pull requestFeb 22, 2023
tkoeppe pushed a commit that referenced this pull requestMar 7, 2023
tkoeppe pushed a commit that referenced this pull requestMar 11, 2023
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@tkoeppetkoeppetkoeppe left review comments

@cpplearnercpplearnercpplearner left review comments

@CaseyCarterCaseyCarterCaseyCarter approved these changes

@timsong-cpptimsong-cpptimsong-cpp approved these changes

Assignees

@tkoeppetkoeppe

Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

[meta.type.synop] (and other) Repetitive 'inline constexpr'?
8 participants
@jensmaurer@zygoloid@tkoeppe@CaseyCarter@jwakely@cpplearner@timsong-cpp@wg21bot

[8]ページ先頭

©2009-2025 Movatter.jp