llvm-project/clang/test/Modules/pcm-with-errors.cpp
Alejandro Álvarez Ayllón c1ecc0d168
[clang] Allow generating module interfaces with parsing errors (#121485)
Fixes a regression introduced in commit
da00c60dae0040185dc45039c4397f6e746548e9

This functionality was originally added in commit
5834996fefc937d6211dc8c8a5b200068753391a

Co-authored-by: Tomasz Kaminski <tomasz.kaminski@sonarsource.com>
2025-01-03 09:43:53 +08:00

27 lines
781 B
C++

// RUN: rm -rf %t
// RUN: split-file %s %t
// RUN: cd %t
// RUN: %clang_cc1 -std=c++23 m.cppm -emit-module-interface -o m.pcm -fallow-pcm-with-compiler-errors -verify
// RUN: %clang_cc1 -std=c++23 main.cpp -fmodule-file=m=m.pcm -verify -fallow-pcm-with-compiler-errors -verify
// RUN: %clang_cc1 -std=c++23 m.cppm -fmodules-reduced-bmi -emit-module-interface -o m.pcm -fallow-pcm-with-compiler-errors -verify
// RUN: %clang_cc1 -std=c++23 main.cpp -fmodule-file=m=m.pcm -verify -fallow-pcm-with-compiler-errors -verify
//--- m.cppm
export module m;
export int f() {
return 0;
}
export struct Foo {
__Int bar; // expected-error {{unknown type name '__Int'}}
};
//--- main.cpp
// expected-no-diagnostics
import m; // ok
static_assert(__is_same(decltype(f), int())); // ok