Commit Graph

1 Commits

Author SHA1 Message Date
Chuanqi Xu 4f8916cfdd [C++20] [Modules] Exit early if export decl is not valid
This patch fixes a crash due to following simple program:
> export struct Unit {
>    bool operator<(const Unit&);
> };

It would crash since the compiler would set the module ownership for
Unit. And the declaration with a module ownership is assumed to own a
module. But here isn't one. So here is the crash.

This patch fixes this by exiting early if it finds the export decl is
already invalid.

Reviewed By: aaron.ballman

Differential Revision: https://reviews.llvm.org/D117093
2022-01-14 10:21:42 +08:00