mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-25 23:56:05 +00:00

This addresses a FIXME in ASTReader. Modules were already re-exported for Preprocessor, but not for Sema. The result was that, with -fmodules-local-submodule-visibility, all AST nodes belonging to a module that was loaded in a premable where not accesible from the main part of the file and a diagnostic recommending importing those modules would be generated. Differential Revision: https://reviews.llvm.org/D86069
16 lines
585 B
C++
16 lines
585 B
C++
// Check that modules included in the preamble remain visible to the rest of the
|
|
// file.
|
|
|
|
// RUN: rm -rf %t.mcp
|
|
// RUN: %clang_cc1 -emit-pch -o %t.pch %s -fmodules -fmodule-map-file=%S/Inputs/modules/module.modulemap -fmodules-local-submodule-visibility -fmodules-cache-path=%t.mcp
|
|
// RUN: %clang_cc1 -include-pch %t.pch %s -fmodules -fmodule-map-file=%S/Inputs/modules/module.modulemap -fmodules-local-submodule-visibility -fmodules-cache-path=%t.mcp
|
|
|
|
#ifndef MAIN_FILE
|
|
#define MAIN_FILE
|
|
// Premable section.
|
|
#include "Inputs/modules/Foo.h"
|
|
#else
|
|
// Main section.
|
|
MyType foo;
|
|
#endif
|