[PATCH] D121465: WIP: [clang][modules] Do not report declarations without linkage as ambiguous

Volodymyr Sapsai via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Mar 15 21:24:10 PDT 2022


vsapsai added a comment.

My concern with this approach is I'm not sure if `isEquivalentInternalLinkageDeclaration` is a desired long-term solution for anonymous C++ enums. If it is, we can piggy-back on it, otherwise hitching our wagon to this train might be undesirable.

Also I need to check the patch again because NonExternal != Internal is not easy for my comprehension.



================
Comment at: clang/test/Modules/ambiguous-anonymous-enum-lookup.m.cpp:9
+#define TEXTUAL_H
+enum { kAnonymousEnumValue = 0 };
+#endif
----------------
For enums it is nice to test having a constant that references another constant in the same enum. E.g., `kAnonymousEnumAnotherValue = kAnonymousEnumValue + 1`.


================
Comment at: clang/test/Modules/ambiguous-anonymous-enum-lookup.m.cpp:38
+
+int testReferencingAnonymousEnumConstant() {
+  return kAnonymousEnumValue; // expected-no-diagnostics
----------------
Should we test also non-equivalent enums or is it tested somewhere else?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D121465/new/

https://reviews.llvm.org/D121465



More information about the cfe-commits mailing list