mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-27 03:56:08 +00:00

When modules are disabled, there's no loaded module for these import decls to point at. This results in crashes when there are modulemap files but no -fmodules flag (this configuration is used for layering check violations). This patch makes sure import declarations are introduced only when modules are enabled, which makes this case similar to textual headers (no import decls are created for #include of textual headers from a modulemap). Differential Revision: https://reviews.llvm.org/D152274
7 lines
355 B
C++
7 lines
355 B
C++
// Make sure we don't crash when serializing a PCH with an include from a
|
|
// modulemap file in nomodules mode.
|
|
// No need to pass -fno-modules explicitly, absence implies negation for cc1.
|
|
// RUN: %clang_cc1 -I %S/Inputs/modulemaps-nomodules -fmodule-map-file=%S/Inputs/modulemaps-nomodules/module.modulemap %s -emit-pch -o /dev/null
|
|
|
|
#include "header.h"
|