This is an archive of the discontinued LLVM Phabricator instance.

[clang-repl] Disambiguate declarations with private typedefs
ClosedPublic

Authored by Hahnfeld on Aug 14 2023, 1:03 AM.

Details

Summary

Member functions and static variable definitions may use typedefs that
are private in the global context, but fine in the class context.

Diff Detail

Event Timeline

Hahnfeld created this revision.Aug 14 2023, 1:03 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 14 2023, 1:03 AM
Hahnfeld requested review of this revision.Aug 14 2023, 1:03 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 14 2023, 1:03 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript
v.g.vassilev added inline comments.Aug 18 2023, 7:58 AM
clang/lib/Parse/ParseTentative.cpp
95

I am wondering what is the false positive rate of this change? That is, if we enable incremental parsing by default (in a local build) and then run all tests which do not produce diagnostics.

clang/test/Interpreter/disambiguate-decl-stmt.cpp
78

Could we move the diagnostic-producing cases in a separate file?

Hahnfeld added inline comments.Aug 21 2023, 2:15 AM
clang/lib/Parse/ParseTentative.cpp
95

With this patch and enabling IncrementalExtensions by default, it's at least not worse than current main: For all of check-clang, I see a number of failing unit tests that start hoarding some memory and are killed with std::bad_alloc or are stuck using 100% CPU. Those we probably want to debug independently of this change...

clang/test/Interpreter/disambiguate-decl-stmt.cpp
78

We could, but I'm actually not a big fan because it moves the expected failing test away from the related disambiguation tests above...

v.g.vassilev accepted this revision.Aug 21 2023, 3:03 AM

This change looks reasonable to me.

clang/test/Interpreter/disambiguate-decl-stmt.cpp
78

Okay, fair enough.

This revision is now accepted and ready to land.Aug 21 2023, 3:03 AM