[clang] [PATCH 1/7] [clang] Improve nested name specifier AST representation (PR #147835)

Daniel M. Katz via cfe-commits cfe-commits at lists.llvm.org
Sun Aug 3 09:28:09 PDT 2025


katzdm wrote:

Hey @mizvekov - Just wanted to point out a few C++26 changes to nested-name-specifiers (via P2996), in case it helps in any way to future-proof your design.
- A nested-name-specifier can now be either "_splice-specifier_ `::`" or "`template` _splice-specialization-specifier_ `::`", where _splice-specifier_ is "`[:` _constant-expression_ `:]`" and the _constant-expression_ may be dependent (so we may not yet know at parse-time whether it designates a type or a namespace); _splice-specialization-specifier_ is a _splice-specifier_ followed by a template argument list ([expr.prim.id.qual], [basic.splice]).
- A nested-name-specifier of the form "_namespace-name_ `::`" can now be dependent, e.g.,

```cpp
template <std::meta::info R>
  requires is_namespace(R)
int f() {
  namespace Alias = [:R:];
  return Alias::constant;  // 'Alias::' is a dependent namespace-name ([temp.dep.namespace]).
}
```

Hope that neither of these complicate your refactor! Looks like super impressive work; looking forward to seeing it land.

https://github.com/llvm/llvm-project/pull/147835


More information about the cfe-commits mailing list