Chuanqi Xu 762962174e [Modules] Don't judge if we're compiling a module unit by LangOpts::CurrentModule.empty()
Closing https://github.com/llvm/llvm-project/issues/57778.

Previously it judge if we're compiling a module unit by
LangOpts::CurrentModule.empty(). But it is not true since we can specify
the module name by `-fmodule-name` option for arbitrary module unit.
Then this patch adjuest the judgement properly.
2022-09-18 16:43:30 +08:00

7 lines
208 B
C++

// RUN: %clang_cc1 -std=c++20 -fmodule-name=test -fsyntax-only %s -verify
// expected-no-diagnostics
// Ensure that we won't crash if we specified `-fmodule-name` in `c++20`
// for a non module unit.
int a;