[PATCH] D114833: [modules] Fix ambiguous name lookup for enum constants from hidden submodules.

2021-12-13 Thread Volodymyr Sapsai via Phabricator via cfe-commits
vsapsai planned changes to this revision. vsapsai added a comment. In discussions outside of this review the consensus is that "warning: ambiguous use of internal linkage declaration" is correct, so I won't change anything for C++. For Objective-C I still need to find a way to handle anonymous e

[PATCH] D114833: [modules] Fix ambiguous name lookup for enum constants from hidden submodules.

2021-12-01 Thread Volodymyr Sapsai via Phabricator via cfe-commits
vsapsai added a subscriber: Bigcheese. vsapsai added a comment. Adding Michael who is infinitely better than me in C++. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D114833/new/ https://reviews.llvm.org/D114833

[PATCH] D114833: [modules] Fix ambiguous name lookup for enum constants from hidden submodules.

2021-12-01 Thread Volodymyr Sapsai via Phabricator via cfe-commits
vsapsai added a comment. As I was trying to replicate C++ behavior I've created a test case ambiguous-anonymous-enum-lookup.cpp. And it results in diagnostics clang/test/Modules/Output/ambiguous-anonymous-enum-lookup.cpp.tmp/test.cpp:6:10: warning: ambiguous use of internal linkage declarati

[PATCH] D114833: [modules] Fix ambiguous name lookup for enum constants from hidden submodules.

2021-12-01 Thread Volodymyr Sapsai via Phabricator via cfe-commits
vsapsai updated this revision to Diff 391189. vsapsai added a comment. Attempt to restore a previous commit. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D114833/new/ https://reviews.llvm.org/D114833 Files: clang/lib/Sema/SemaDecl.cpp clang/te

[PATCH] D114833: [modules] Fix ambiguous name lookup for enum constants from hidden submodules.

2021-12-01 Thread Volodymyr Sapsai via Phabricator via cfe-commits
vsapsai updated this revision to Diff 391187. vsapsai added a comment. Add a test case for referencing an anonymous enum constant in C++. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D114833/new/ https://reviews.llvm.org/D114833 Files: clang/tes

[PATCH] D114833: [modules] Fix ambiguous name lookup for enum constants from hidden submodules.

2021-12-01 Thread Volodymyr Sapsai via Phabricator via cfe-commits
vsapsai added a comment. After more testing and thinking I've realized we are still not handling anonymous enums properly. On one hand anonymous EnumDecl aren't duplicates and we aren't making a hidden EnumDecl + EnumConstantDecl visible and don't have ambiguity problems. On the other hand, whe

[PATCH] D114833: [modules] Fix ambiguous name lookup for enum constants from hidden submodules.

2021-11-30 Thread Volodymyr Sapsai via Phabricator via cfe-commits
vsapsai added inline comments. Comment at: clang/lib/Sema/SemaDecl.cpp:16216-16223 if (!getLangOpts().CPlusPlus) { // Postpone making the old definition visible until after we // complete parsing the new one and do the struct

[PATCH] D114833: [modules] Fix ambiguous name lookup for enum constants from hidden submodules.

2021-11-30 Thread Volodymyr Sapsai via Phabricator via cfe-commits
vsapsai created this revision. vsapsai added reviewers: bruno, jansvoboda11, rsmith. Herald added a subscriber: ributzka. vsapsai requested review of this revision. Herald added a project: clang. Fix errors like clang/test/Modules/redefinition-c-tagtypes.m:36:10: error: reference to 'FST' is a