Files
clang-p2996/clang/test/Modules/pr67627.cppm
Chuanqi Xu f9558c6911 [C++20] [Modules] Handle import decl before module declaration without being in GMF
Close https://github.com/llvm/llvm-project/issues/67627

In a module unit, all the declaration before the modoule declaration
should live in the GMF.
2023-09-28 10:24:50 +08:00

14 lines
487 B
C++

// RUN: rm -rf %t
// RUN: mkdir -p %t
// RUN: split-file %s %t
//
// RUN: %clang_cc1 -std=c++20 %t/A.cppm -emit-module-interface -o %t/A.pcm
// RUN: %clang_cc1 -std=c++20 %t/B.cppm -fmodule-file=A=%t/A.pcm -fsyntax-only -verify
//--- A.cppm
export module A;
//--- B.cppm
import A; // expected-note {{add 'module;' to the start of the file to introduce a global module fragment}}
export module B; // expected-error {{module declaration must occur at the start of the translation unit}}