[PATCH] D142316: [clang] Add test for CWG2396
Vlad Serebrennikov via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Sun Feb 12 04:44:49 PST 2023
Endill marked an inline comment as not done.
Endill added inline comments.
================
Comment at: clang/test/CXX/drs/dr23xx.cpp:202
+ // void g2(A a) { a.operator B decltype(B())::*(); }
+ // void h(A a) { a.operator identity<B>::type B::*(); }
+ // void h2(A a) { a.operator B identity<B>::type::*(); }
----------------
shafik wrote:
> Endill wrote:
> > shafik wrote:
> > > While gcc accepts the first three it does not like the last two: https://godbolt.org/z/js8Pz14Eo
> > >
> > > I believe they should also be covered but not confident.
> > I agree they should. I can't find any special considerations in the standard regarding unqualified name lookup of template arguments.
> >
> > Are there any action items for me here?
> Yeah, can you file a gcc bug report for the last two? If they agree it is a gcc but then we are all good, if not then we need to see what they say.
Upon closer inspection, I think I'm wrong to put those two tests that GCC does not accept:
1. [[ http://eel.is/c++draft/basic.lookup.unqual#5.sentence-1 | basic.lookup.unqual#5 ]]: `An unqualified name that is a component name of a type-specifier or ptr-operator of a conversion-type-id is looked up in the same fashion as the conversion-function-id in which it appears`
2. [[ http://eel.is/c++draft/expr.prim.id.unqual#2 | expr.prim.id.unqual#2 ]]: `A component name of an unqualified-id U is: — U if it is a name or; — the component name of the template-id or type-name of U, if any.`
3. [[ http://eel.is/c++draft/temp.names#2 | temp.names#2 ]]: `The component name of a simple-template-id, template-id, or template-name is the first name in it`
As I understand it now, `identity` is a component name of ptr-declarator and falls under "is looked up in the same fashion as the conversion-function-id in which it appears", but its argument `B` does not.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D142316/new/
https://reviews.llvm.org/D142316
More information about the cfe-commits
mailing list