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
[temp.deduct.general] Clarify explicit-specifier and exception specifications CWG2618 #5130
Conversation
@cmeerw, something like this? |
yes, looks good to me. |
@jensmaurer Should we also improve the second sentence of [temp.deduct.general] p8 to make [temp.deduct.general.note.4] have a formal explanation? The current sentence is that
I think we may change it to
In other words, the substitution in exception specification that would result in invalid types and expressions can make the program be ill-formed, which is what the note saying Incidentally, the deduction failure can also occur in the default argument of a template parameter. For instance struct A{
using type = int;
};
template<class T, int U = T::v>
void fun(T){};
template<class T>
void fun(T*){}
int main(){
A* ptr = 0;
fun(ptr);
} The current wording only mentions the template parameter types. |
@xmh0511, since this is not the place where we specify exactly where we substitute, we can be a bit hazy here. We should not be incorrect. I've fixed the obvious problem, and I've moved the "only" to apply to "immediate context", not to "invalid stuff". |
its template parameter types, | ||
Invalid types and expressions only in the immediate context of | ||
the function's type outside of the exception specification, | ||
its template parameters, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jensmaurer Could we change template parameters
to template-parameters; It would indicate the deduction failures in default template arguments are also covered by these rules. In the same manner as the latter case(i.e, use its grammar to expound the rule).
@jensmaurer Could this be something you could quickly look at in CWG? No objections otherwise, but if you have a slot for GitHub reviews, it would be nice to get core sign-off. |
Created CWG2618 for CWG review and visibility. |
Fixes #5129