AST: Properly calculate the linkage of a IndirectFieldDecl
getLVForNamespaceScopeDecl believed that it wasn't possible for it to
ever see an IndirectFieldDecl. However, this can occur when determining
whether or not something is a redeclaration of a member of an anonymous
static union.
This fixes PR21858.
llvm-svn: 223975
diff --git a/clang/test/SemaCXX/anonymous-union.cpp b/clang/test/SemaCXX/anonymous-union.cpp
index fde27b04..3b568fd 100644
--- a/clang/test/SemaCXX/anonymous-union.cpp
+++ b/clang/test/SemaCXX/anonymous-union.cpp
@@ -84,6 +84,10 @@
float float_val2;
};
+void PR21858() {
+ void int_val2();
+}
+
void f() {
int_val2 = 0;
float_val2 = 0.0;