From 59afd6ad83665ad93d3c87af238a21a9c1c38079 Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Tue, 4 Feb 2020 13:40:56 +0100 Subject: [PATCH] libcpp: Diagnose __has_include outside of preprocessor directives [PR93545] Add forgotten gcc/testsuite/c-c++-common/gomp/has-include-1.c. 2020-02-04 Jakub Jelinek * macro.c (builtin_has_include): Diagnose __has_include* use outside of preprocessing directives. * c-c++-common/cpp/has-include-1.c: New test. * c-c++-common/cpp/has-include-next-1.c: New test. * c-c++-common/gomp/has-include-1.c: New test. --- gcc/testsuite/c-c++-common/gomp/has-include-1.c | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 gcc/testsuite/c-c++-common/gomp/has-include-1.c diff --git a/gcc/testsuite/c-c++-common/gomp/has-include-1.c b/gcc/testsuite/c-c++-common/gomp/has-include-1.c new file mode 100644 index 00000000000..bb1b9052685 --- /dev/null +++ b/gcc/testsuite/c-c++-common/gomp/has-include-1.c @@ -0,0 +1,8 @@ +/* { dg-do compile } */ + +void +foo (void) +{ +#pragma omp parallel if (__has_include ("")) /* { dg-error "used outside of preprocessing directive" } */ + ; +} -- 2.30.2