On Mon, Mar 30, 2026 at 01:15:07PM +0200, Tomasz Kaminski wrote:
> > auto
> > Q::baz () -> typename [: current_namespace () == ^^Q ? ^^int : ^^:: :]
> > {
> >   return 0;
> > }
> > part also fails, there I don't know what's right but possibly it should
> > be in Q; in that case it would be a pre-existing bug already for
> > std::meta::access_context::current () too.
> >
> My reading of the standard may be wrong here.

int a;
namespace N
{
  long a;
  long foo ();
}
auto
N::foo () -> decltype (a)
{
  return 0;
}
is accepted though, so it must be looking up a in the N namespace.
Will look at it.

> >   If you meant static_assert, then why is the
> > condition the same except ^^W vs. ^^T at the end and w would
> > need to be constexpr.
> 
> My intent here was to test, if  for default-initialzied variable we call
> constructors, so if we do W(), then W().t will correspond to default
> constructor of T, and W().w to default constructor of W.
> 
> However, if we use brace initialization W{}, then the members correspond
> to the location of the expressions, so both W{}.t and W{}.w are representing
> enclosing function.

Ok, will try something soon.

        Jakub

Reply via email to