Sema: Properly perform lookup when acting on fields for desig inits
Clang used a custom implementation of lookup when handling designated
initializers. The custom code was not particularly optimized and relied
on standard lookup for typo-correction anyway.
This custom code has to go, it doesn't properly support MSVC-style
anonymous structs embedded inside other records; replace it with the
typo-correction path.
This has the side effect of speeding up semantic handling of the fields
for a designated initializer while simplifying the code at the same
time.
This fixes PR20573.
Differential Revision: http://reviews.llvm.org/D4839
llvm-svn: 215372
diff --git a/clang/test/Sema/MicrosoftExtensions.c b/clang/test/Sema/MicrosoftExtensions.c
index f640120..908ec04 100644
--- a/clang/test/Sema/MicrosoftExtensions.c
+++ b/clang/test/Sema/MicrosoftExtensions.c
@@ -39,6 +39,8 @@
NESTED1; // expected-warning {{anonymous structs are a Microsoft extension}}
};
+struct nested2 PR20573 = { .a = 3 };
+
struct nested3 {
long d;
struct nested4 { // expected-warning {{anonymous structs are a Microsoft extension}}