[clang] [clang] Fix incorrect 'namespace' in diagnostic for out-of-line declarations (PR #230630)

Yanzuo Liu via cfe-commits cfe-commits at lists.llvm.org
Fri Oct 9 19:16:55 PDT 2026


================
@@ -9063,7 +9063,7 @@ def err_typecheck_deleted_function : Error<
 def err_expected_class_or_namespace : Error<"%0 is not a class"
   "%select{ or namespace|, namespace, or enumeration}1">;
 def err_invalid_declarator_scope : Error<"cannot define or redeclare %0 here "
-  "because namespace %1 does not enclose namespace %2">;
+  "because namespace %1 does not enclose %select{namespace|struct|class|union|enum}2 %3">;
----------------
zwuis wrote:

Use `%enum_select`.

https://clang.llvm.org/docs/InternalsManual.html#formatting-a-diagnostic-argument

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


More information about the cfe-commits mailing list