diff --git a/clang/test/Modules/compare-record.c b/clang/test/Modules/compare-record.c index c5ce285aa77ee..60998696969e1 100644 --- a/clang/test/Modules/compare-record.c +++ b/clang/test/Modules/compare-record.c @@ -423,10 +423,13 @@ struct CompareDifferentFieldInIndirectStruct compareIndirectStruct; // expected-error@second-nested-struct.h:* {{'IndirectStruct::mismatchingField' from module 'Second' is not present in definition of 'struct IndirectStruct' in module 'First.Hidden'}} // expected-note@first-nested-struct.h:* {{declaration of 'mismatchingField' does not match}} #elif defined(CASE3) -// This currently doesn't produce an error, because there is no dependency -// on the layout of DirectStruct. -// expected-no-diagnostics +// expected-error@second-nested-struct.h:* {{'IndirectStruct::mismatchingField' from module 'Second' is not present in definition of 'struct IndirectStruct' in module 'First.Hidden'}} +// expected-note@first-nested-struct.h:* {{declaration of 'mismatchingField' does not match}} struct CompareIndirectStructPointer compareIndirectStructPointer; +struct DirectStruct test() { + // Make sure the type behind the pointer is inspected. + return *compareIndirectStructPointer.directFieldPointer; +} #endif //--- include/first-anonymous.h