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

[intro.defs] Default template arguments are not part of the signature #1916

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

jensmaurer
Copy link
Member

Fixes #1702.

@zygoloid
Copy link
Member

zygoloid commented Apr 1, 2018

Ugh, what about this:

template<template<typename = int> typename X, X<> *Y> void f() {}
template<template<typename = float> typename X, X<> *Y> void f() {}

The default template argument here really is part of the signature.

I think what we really need to emphasize here is that signatures only matter up to equivalence. The above two declarations are not equivalent because their signatures are not equivalent (because of [basic.def.odr]/12.5, which presumably is intended to apply to default template arguments too).

We get this wrong in [basic.link]/10.4 ("the same" should be "equivalent"), and somewhat also in [namespace.udir]/7 (but this only applies to non-templated functions, so it's less of an issue). I don't think we can include this in the definition of "signature", though, due to ISO's insistence on definitions being substitutable into their point of use.

@jensmaurer jensmaurer added the decision-required A decision of the editorial group (or the Project Editor) is required. label Oct 11, 2018
@jensmaurer jensmaurer added not-editorial Issue is not deemed editorial; the editorial issue is kept open for tracking. and removed decision-required A decision of the editorial group (or the Project Editor) is required. labels Nov 6, 2018
@jensmaurer
Copy link
Member Author

Editorial meeting: Not editorial.

@tkoeppe
Copy link
Contributor

tkoeppe commented Nov 12, 2023

Could you please rebase?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cwg Issue must be reviewed by CWG. needs rebase The pull request needs a git rebase to resolve merge conflicts. not-editorial Issue is not deemed editorial; the editorial issue is kept open for tracking.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[intro.defs] Should the definition of 'signature' explicitly exclude default template arguments?
4 participants