[clang] [clang] Fix possible nullptr deref in BuildCXXNestedNameSpecifier (PR #166995)

Eli Friedman via cfe-commits cfe-commits at lists.llvm.org
Fri Nov 7 12:57:33 PST 2025


================
@@ -0,0 +1,7 @@
+// RUN: %clang_cc1 -fsyntax-only %s -verify
+namespace a {
+template <class b>
+void c() {
+  ((::c::)); // expected-error {{expected unqualified-id}}
----------------
efriedma-quic wrote:

This looks like we aren't actually diagnosing the error?  I'd expect something like `error: 'c' is not a class, namespace, or enumeration`, which is what we generate in the non-template case.

What happens if you instead write the following?

```
  ((::c::x));
```

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


More information about the cfe-commits mailing list