This is an archive of the discontinued LLVM Phabricator instance.

[flang] Fix an assert on duplicate initializations
ClosedPublic

Authored by PeteSteinfeld on Jul 30 2020, 11:51 AM.

Details

Summary

When declaring the same variable twice with an initialization, we were failing
an internal check. I fixed this by checking to see if the associated symbol
already had an error.

I added tests for pointer and non-pointer initialization of duplicate names.

Diff Detail

Event Timeline

PeteSteinfeld created this revision.Jul 30 2020, 11:51 AM
Herald added a project: Restricted Project. · View Herald Transcript
PeteSteinfeld requested review of this revision.Jul 30 2020, 11:51 AM
PeteSteinfeld added a project: Restricted Project.Jul 30 2020, 11:52 AM
klausler accepted this revision.Jul 30 2020, 11:56 AM
klausler added inline comments.
flang/lib/Semantics/resolve-names.cpp
5683–5700

Might be more clear as if (context().HasError(ultimate)) { } else if (auto *details...)

This revision is now accepted and ready to land.Jul 30 2020, 11:56 AM
This revision was automatically updated to reflect the committed changes.