From 16962ce7c214f12f7362c41bfbe79689bc07ea2f Mon Sep 17 00:00:00 2001 From: Erik Verbruggen Date: Fri, 3 Nov 2017 09:40:07 +0000 Subject: [preamble] Also record the "skipping" state of the preprocessor When a preamble ends in a conditional preprocessor block that is being skipped, the preprocessor needs to continue skipping that block when the preamble is used. This fixes PR34570. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@317308 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/Index/preamble-conditionals-skipping.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 test/Index/preamble-conditionals-skipping.cpp (limited to 'test/Index/preamble-conditionals-skipping.cpp') diff --git a/test/Index/preamble-conditionals-skipping.cpp b/test/Index/preamble-conditionals-skipping.cpp new file mode 100644 index 0000000000..fa5764cd5d --- /dev/null +++ b/test/Index/preamble-conditionals-skipping.cpp @@ -0,0 +1,16 @@ +// RUN: env CINDEXTEST_EDITING=1 c-index-test -test-load-source-reparse 5 \ +// RUN: local -std=c++14 %s 2>&1 \ +// RUN: | FileCheck %s --implicit-check-not "error:" + +#ifdef MYCPLUSPLUS +extern "C" { +#endif + +#ifdef MYCPLUSPLUS +} +#endif + +int main() +{ + return 0; +} -- cgit v1.2.3