We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1373f20 commit b612143Copy full SHA for b612143
clang/lib/AST/Decl.cpp
@@ -4770,7 +4770,10 @@ bool RecordDecl::isOrContainsUnion() const {
4770
RecordDecl::field_iterator RecordDecl::field_begin() const {
4771
if (hasExternalLexicalStorage() && !hasLoadedFieldsFromExternalStorage())
4772
LoadFieldsFromExternalStorage();
4773
-
+ // This is necessary for correctness for C++ with modules.
4774
+ // FIXME: Come up with a test case that breaks without definition.
4775
+ if (RecordDecl *D = getDefinition(); D && D != this)
4776
+ return D->field_begin();
4777
return field_iterator(decl_iterator(FirstDecl));
4778
}
4779
0 commit comments