llvm-project/clang/test/Modules/cxx20-partition-diagnostics-a.cpp
Iain Sandoe 69350e569d [C++20][Modules][3/8] Initial handling for module partitions.
This implements the parsing and recognition of module partition CMIs
and removes the FIXMEs in the parser.

Module partitions are recognised in the base computation of visibility,
however additional amendments to visibility follow in subsequent patches.

Differential Revision: https://reviews.llvm.org/D118586
2022-02-24 09:01:09 +00:00

20 lines
590 B
C++

// Module Partition diagnostics
// RUN: rm -rf %t
// RUN: mkdir -p %t
// RUN: split-file %s %t
// RUN: %clang_cc1 -std=c++20 -fsyntax-only %t/bad-import.cpp -verify
// RUN: %clang_cc1 -std=c++20 -fsyntax-only %t/bad-partition.cpp -verify
//--- bad-import.cpp
import :B; // expected-error {{module partition imports must be within a module purview}}
//--- bad-partition.cpp
module; // expected-error {{missing 'module' declaration at end of global module fragment introduced here}}
import :Part; // expected-error {{module partition imports cannot be in the global module fragment}}