]> git.ipfire.org Git - thirdparty/gcc.git/commit
openmp: Add support for __has_attribute(omp::directive) and __has_attribute(omp:...
authorJakub Jelinek <jakub@redhat.com>
Fri, 23 Jul 2021 07:50:15 +0000 (09:50 +0200)
committerJakub Jelinek <jakub@redhat.com>
Fri, 23 Jul 2021 07:50:15 +0000 (09:50 +0200)
commit7f7364108f7441e6bd6f6f79a2d991e4e0f71b28
tree2be09c88daca7fffbe70c1f7dcafa99e168efe23
parent2c5d803d03209478b4f060785c6f6ba2f0de88ad
openmp: Add support for __has_attribute(omp::directive) and __has_attribute(omp::sequence)

Now that the C++ FE supports these attributes, but not through registering
them in the attributes tables (they work quite differently from other
attributes), this teaches c_common_has_attributes about those.

2021-07-23  Jakub Jelinek  <jakub@redhat.com>

* c-lex.c (c_common_has_attribute): Call canonicalize_attr_name also
on attr_id.  Return 1 for omp::directive or omp::sequence in C++11
and later.

* c-c++-common/gomp/attrs-1.c: New test.
* c-c++-common/gomp/attrs-2.c: New test.
* c-c++-common/gomp/attrs-3.c: New test.
gcc/c-family/c-lex.c
gcc/testsuite/c-c++-common/gomp/attrs-1.c [new file with mode: 0644]
gcc/testsuite/c-c++-common/gomp/attrs-2.c [new file with mode: 0644]
gcc/testsuite/c-c++-common/gomp/attrs-3.c [new file with mode: 0644]