Commit 59afd6ad by Jakub Jelinek

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  <jakub@redhat.com>

	* 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.
parent f8d6e448
/* { dg-do compile } */
void
foo (void)
{
#pragma omp parallel if (__has_include ("<stdlib.h>")) /* { dg-error "used outside of preprocessing directive" } */
;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment