-
Notifications
You must be signed in to change notification settings - Fork 771
[temp.constr.atomic]/2 Meaning of "the same *expression*" is unclear #2554
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
Comments
So, should we add "(same sequence of tokens)" after expression? |
The intended meaning is stronger than "same sequence of tokens." Post-P0717, the intent is that two atomic constraints must be generated from the same utterance in order to be equivalent. For example, given: template<class T> concept C1 = is_same_v<T, int>;
template<class T> concept C2 = is_same_v<T, int>;
void f(C1 auto) {}
void f(C2 auto) {} the call expression |
So, maybe we should say "the same lexical expression", although I'm still unclear how that translates to linkage across translation units. |
Editorial meeting: This phrasing is only used for partial ordering, not for redeclarations (which indirectly uses the ODR). We should have a CWG issue to maybe add "... appearing within the same declaration". |
Similar things are template<class T>
requires (sizeof(T)>0) void fun(T){} //#1
template<class T>
requires (sizeof(T)>0) && true void fun(T){} //#2 when partial ordering #1 and #2, although the atomic constraint |
[temp.const.atomic]/2 says:
Not all readers will note that "expression" is italic here, so that it denotes the grammar-term expression, and if they do they may interpret it to mean that "the same expression" means "generated in the same manner from the grammar". Those who don't arrive at this conclusion will likely follow the cross-reference to [temp.over.link] looking for clarification, and will find [temp.over.link]/5:
"expressions are equivalent" is pretty close to the phrasing "the same expression", and nothing else in [temp.over.link] tells me what it means for two expressions to be "the same", so paragraph 5 must be why [temp.const.atomic]/2 told me to look at [temp.over.link], right?
The text was updated successfully, but these errors were encountered: