https://gcc.gnu.org/bugzilla/show_bug.cgi?id=127707

            Bug ID: 127707
           Summary: [reflection] using typename [:ns:]::X; at block scope
                    in template should declare a type
           Product: gcc
           Version: 17.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: mpolacek at gcc dot gnu.org
  Target Milestone: ---

Found while fixing bug 126654.  When that is fixed, this test:

```
// PR c++/<TODO>
// { dg-do compile { target c++26 } }
// { dg-additional-options "-freflection" }

namespace N {
  struct S {};
}
namespace A = N;
struct S {};

template<auto ns>
void
f ()
{
  using typename [:ns:]::S;
  S s;
}

template<auto ns>
void
f2 ()
{
  [] (auto) {
    using typename [:ns:]::S;
    S s;
  } (0);
}

template<auto ns>
void
fbad ()
{
  using [:ns:]::S;
  S s; // { dg-error "<TODO>" }
}

void
g ()
{
  f<^^::>();
  f<^^N>();
  f<^^A>();
  f2<^^::>();
  f2<^^N>();
  f2<^^A>();
}
```

still doesn't compile due to 

ns12.C: In function ‘void f()’:
ns12.C:16:4: error: expected ‘;’ before ‘s’ [-Wtemplate-body]
   16 |   S s;
      |    ^~
      |    ;

This looks like a failure to propagate USING_DECL_TYPENAME_P.

Reply via email to