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 declaration 'kAnonymousEnumValue' 
defined in multiple modules [-Wmodules-ambiguous-internal-linkage]
    return kAnonymousEnumValue;
           ^
  
clang/test/Modules/Output/ambiguous-anonymous-enum-lookup.cpp.tmp/include/textual.h:5:3:
 note: declared here
    kAnonymousEnumValue = 0,
    ^
  
clang/test/Modules/Output/ambiguous-anonymous-enum-lookup.cpp.tmp/include/textual.h:5:3:
 note: declared here in module 'Piecewise.InitiallyHidden'
    kAnonymousEnumValue = 0,
    ^

Is this warning correct or is it wrong and we have the same bug both in ObjC 
and C++? I feel I am biased (and bad at C++ linkage rules), so need a separate 
opinion on correctness.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D114833

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to