]> granicus.if.org Git - clang/commit
Change enumerator default linkage type for C
authorBruno Cardoso Lopes <bruno.cardoso@gmail.com>
Sat, 1 Jul 2017 00:06:27 +0000 (00:06 +0000)
committerBruno Cardoso Lopes <bruno.cardoso@gmail.com>
Sat, 1 Jul 2017 00:06:27 +0000 (00:06 +0000)
commit9a860738b816ad8756eb18113ff146c7f2899960
treeb06fb085a0dbf20bf9164e7dce342fd409bfc412
parent7fd4191f69e7fdc107617a4beb0078cd0c7cf149
Change enumerator default linkage type for C

Redeclaration lookup should never find hidden enumerators in C, because
they do not have linkage (C11 6.2.2/6)

The linkage of an enumerator should be VisibleNoLinkage, and
isHiddenDeclarationVisible should be checking hasExternalFormalLinkage.

This is was reviewed as part of D31778, but splitted into a different
commit for clarity.

rdar://problem/31909368

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@306917 91177308-0d34-0410-b5e6-96231b3b80d8
include/clang/Basic/Visibility.h
include/clang/Sema/Lookup.h
lib/AST/Decl.cpp
test/Index/linkage.c