--- gcc/c-family/c-lex.cc.jj	2023-10-08 16:37:31.301279702 +0200
+++ gcc/c-family/c-lex.cc	2023-11-04 09:19:58.739016364 +0100
@@ -367,15 +367,13 @@ c_common_has_attribute (cpp_reader *pfil
 		= get_identifier ((const char *)
 				  cpp_token_as_text (pfile, nxt_token));
 	      attr_id = canonicalize_attr_name (attr_id);
-	      if (c_dialect_cxx ())
-		{
-		  /* OpenMP attributes need special handling.  */
-		  if ((flag_openmp || flag_openmp_simd)
-		      && is_attribute_p ("omp", attr_ns)
-		      && (is_attribute_p ("directive", attr_id)
-			  || is_attribute_p ("sequence", attr_id)))
-		    result = 1;
-		}
+	      /* OpenMP attributes need special handling.  */
+	      if ((flag_openmp || flag_openmp_simd)
+		  && is_attribute_p ("omp", attr_ns)
+		  && (is_attribute_p ("directive", attr_id)
+		      || is_attribute_p ("sequence", attr_id)
+		      || is_attribute_p ("decl", attr_id)))
+		result = 1;
 	      if (result)
 		attr_name = NULL_TREE;
 	      else
--- gcc/testsuite/c-c++-common/gomp/attrs-1.c.jj	2021-07-23 09:50:02.429080908 +0200
+++ gcc/testsuite/c-c++-common/gomp/attrs-1.c	2023-11-04 09:39:37.770503402 +0100
@@ -1,144 +1,96 @@
 /* { dg-do compile } */
 /* { dg-options "-fopenmp" } */
 
-#if __has_attribute(omp::directive)
-#ifndef __cplusplus
-#error omp::directive supported in C
-#endif
-#else
-#ifdef __cplusplus
-#error omp::directive not supported in C++
-#endif
+#if !__has_attribute(omp::directive)
+#error omp::directive not supported in C/C++
 #endif
 
-#if __has_attribute(omp::sequence)
-#ifndef __cplusplus
-#error omp::sequence supported in C
-#endif
-#else
-#ifdef __cplusplus
-#error omp::sequence not supported in C++
+#if !__has_attribute(omp::sequence)
+#error omp::sequence not supported in C/C++
 #endif
+
+#if !__has_attribute(omp::decl)
+#error omp::decl not supported in C/C++
 #endif
 
 #if __has_attribute(omp::unknown)
 #error omp::unknown supported
 #endif
 
-#if __has_cpp_attribute(omp::directive)
-#ifndef __cplusplus
-#error omp::directive supported in C
-#endif
-#else
-#ifdef __cplusplus
-#error omp::directive not supported in C++
-#endif
+#if !__has_cpp_attribute(omp::directive)
+#error omp::directive not supported in C/C++
 #endif
 
-#if __has_cpp_attribute(omp::sequence)
-#ifndef __cplusplus
-#error omp::sequence supported in C
-#endif
-#else
-#ifdef __cplusplus
-#error omp::sequence not supported in C++
+#if !__has_cpp_attribute(omp::sequence)
+#error omp::sequence not supported in C/C++
 #endif
+
+#if !__has_cpp_attribute(omp::decl)
+#error omp::sequence not supported in C/C++
 #endif
 
 #if __has_cpp_attribute(omp::unknown)
 #error omp::unknown supported
 #endif
 
-#if __has_attribute(__omp__::__directive__)
-#ifndef __cplusplus
-#error __omp__::__directive__ supported in C
-#endif
-#else
-#ifdef __cplusplus
-#error __omp__::__directive__ not supported in C++
-#endif
+#if !__has_attribute(__omp__::__directive__)
+#error __omp__::__directive__ not supported in C/C++
 #endif
 
-#if __has_attribute(__omp__::__sequence__)
-#ifndef __cplusplus
-#error __omp__::__sequence__ supported in C
-#endif
-#else
-#ifdef __cplusplus
-#error __omp__::__sequence__ not supported in C++
+#if !__has_attribute(__omp__::__sequence__)
+#error __omp__::__sequence__ not supported in C/C++
 #endif
+
+#if !__has_attribute(__omp__::__decl__)
+#error __omp__::__decl__ not supported in C/C++
 #endif
 
 #if __has_attribute(__omp__::__unknown__)
 #error __omp__::__unknown__ supported
 #endif
 
-#if __has_cpp_attribute(__omp__::__directive__)
-#ifndef __cplusplus
-#error __omp__::__directive__ supported in C
-#endif
-#else
-#ifdef __cplusplus
-#error __omp__::__directive__ not supported in C++
-#endif
+#if !__has_cpp_attribute(__omp__::__directive__)
+#error __omp__::__directive__ not supported in C/C++
 #endif
 
-#if __has_cpp_attribute(__omp__::__sequence__)
-#ifndef __cplusplus
-#error __omp__::__sequence__ supported in C
-#endif
-#else
-#ifdef __cplusplus
-#error __omp__::__sequence__ not supported in C++
+#if !__has_cpp_attribute(__omp__::__sequence__)
+#error __omp__::__sequence__ not supported in C/C++
 #endif
+
+#if !__has_cpp_attribute(__omp__::__decl__)
+#error __omp__::__decl__ not supported in C/C++
 #endif
 
 #if __has_cpp_attribute(__omp__::__unknown__)
 #error __omp__::__unknown__ supported
 #endif
 
-#if __has_attribute(omp::__directive__)
-#ifndef __cplusplus
-#error omp::__directive__ supported in C
-#endif
-#else
-#ifdef __cplusplus
-#error omp::__directive__ not supported in C++
-#endif
+#if !__has_attribute(omp::__directive__)
+#error omp::__directive__ not supported in C/C++
 #endif
 
-#if __has_attribute(__omp__::sequence)
-#ifndef __cplusplus
-#error __omp__::sequence supported in C
-#endif
-#else
-#ifdef __cplusplus
-#error __omp__::sequence not supported in C++
+#if !__has_attribute(__omp__::sequence)
+#error __omp__::sequence not supported in C/C++
 #endif
+
+#if !__has_attribute(omp::__decl__)
+#error omp::__decl__ not supported in C/C++
 #endif
 
 #if __has_attribute(omp::__unknown__)
 #error omp::__unknown__ supported
 #endif
 
-#if __has_cpp_attribute(__omp__::directive)
-#ifndef __cplusplus
-#error __omp__::directive supported in C
-#endif
-#else
-#ifdef __cplusplus
-#error __omp__::directive not supported in C++
-#endif
+#if !__has_cpp_attribute(__omp__::directive)
+#error __omp__::directive not supported in C/C++
 #endif
 
-#if __has_cpp_attribute(omp::__sequence__)
-#ifndef __cplusplus
-#error omp::__sequence__ supported in C
-#endif
-#else
-#ifdef __cplusplus
-#error omp::__sequence__ not supported in C++
+#if !__has_cpp_attribute(omp::__sequence__)
+#error omp::__sequence__ not supported in C/C++
 #endif
+
+#if !__has_cpp_attribute(__omp__::decl)
+#error __omp__::decl not supported in C/C++
 #endif
 
 #if __has_cpp_attribute(__omp__::unknown)
--- gcc/testsuite/c-c++-common/gomp/attrs-2.c.jj	2021-07-23 09:50:02.429080908 +0200
+++ gcc/testsuite/c-c++-common/gomp/attrs-2.c	2023-11-04 09:39:43.542421872 +0100
@@ -1,144 +1,96 @@
 /* { dg-do compile } */
 /* { dg-options "-fno-openmp -fopenmp-simd" } */
 
-#if __has_attribute(omp::directive)
-#ifndef __cplusplus
-#error omp::directive supported in C
-#endif
-#else
-#ifdef __cplusplus
-#error omp::directive not supported in C++
-#endif
+#if !__has_attribute(omp::directive)
+#error omp::directive not supported in C/C++
 #endif
 
-#if __has_attribute(omp::sequence)
-#ifndef __cplusplus
-#error omp::sequence supported in C
-#endif
-#else
-#ifdef __cplusplus
-#error omp::sequence not supported in C++
+#if !__has_attribute(omp::sequence)
+#error omp::sequence not supported in C/C++
 #endif
+
+#if !__has_attribute(omp::decl)
+#error omp::decl not supported in C/C++
 #endif
 
 #if __has_attribute(omp::unknown)
 #error omp::unknown supported
 #endif
 
-#if __has_cpp_attribute(omp::directive)
-#ifndef __cplusplus
-#error omp::directive supported in C
-#endif
-#else
-#ifdef __cplusplus
-#error omp::directive not supported in C++
-#endif
+#if !__has_cpp_attribute(omp::directive)
+#error omp::directive not supported in C/C++
 #endif
 
-#if __has_cpp_attribute(omp::sequence)
-#ifndef __cplusplus
-#error omp::sequence supported in C
-#endif
-#else
-#ifdef __cplusplus
-#error omp::sequence not supported in C++
+#if !__has_cpp_attribute(omp::sequence)
+#error omp::sequence not supported in C/C++
 #endif
+
+#if !__has_cpp_attribute(omp::decl)
+#error omp::sequence not supported in C/C++
 #endif
 
 #if __has_cpp_attribute(omp::unknown)
 #error omp::unknown supported
 #endif
 
-#if __has_attribute(__omp__::__directive__)
-#ifndef __cplusplus
-#error __omp__::__directive__ supported in C
-#endif
-#else
-#ifdef __cplusplus
-#error __omp__::__directive__ not supported in C++
-#endif
+#if !__has_attribute(__omp__::__directive__)
+#error __omp__::__directive__ not supported in C/C++
 #endif
 
-#if __has_attribute(__omp__::__sequence__)
-#ifndef __cplusplus
-#error __omp__::__sequence__ supported in C
-#endif
-#else
-#ifdef __cplusplus
-#error __omp__::__sequence__ not supported in C++
+#if !__has_attribute(__omp__::__sequence__)
+#error __omp__::__sequence__ not supported in C/C++
 #endif
+
+#if !__has_attribute(__omp__::__decl__)
+#error __omp__::__decl__ not supported in C/C++
 #endif
 
 #if __has_attribute(__omp__::__unknown__)
 #error __omp__::__unknown__ supported
 #endif
 
-#if __has_cpp_attribute(__omp__::__directive__)
-#ifndef __cplusplus
-#error __omp__::__directive__ supported in C
-#endif
-#else
-#ifdef __cplusplus
-#error __omp__::__directive__ not supported in C++
-#endif
+#if !__has_cpp_attribute(__omp__::__directive__)
+#error __omp__::__directive__ not supported in C/C++
 #endif
 
-#if __has_cpp_attribute(__omp__::__sequence__)
-#ifndef __cplusplus
-#error __omp__::__sequence__ supported in C
-#endif
-#else
-#ifdef __cplusplus
-#error __omp__::__sequence__ not supported in C++
+#if !__has_cpp_attribute(__omp__::__sequence__)
+#error __omp__::__sequence__ not supported in C/C++
 #endif
+
+#if !__has_cpp_attribute(__omp__::__decl__)
+#error __omp__::__decl__ not supported in C/C++
 #endif
 
 #if __has_cpp_attribute(__omp__::__unknown__)
 #error __omp__::__unknown__ supported
 #endif
 
-#if __has_attribute(omp::__directive__)
-#ifndef __cplusplus
-#error omp::__directive__ supported in C
-#endif
-#else
-#ifdef __cplusplus
-#error omp::__directive__ not supported in C++
-#endif
+#if !__has_attribute(omp::__directive__)
+#error omp::__directive__ not supported in C/C++
 #endif
 
-#if __has_attribute(__omp__::sequence)
-#ifndef __cplusplus
-#error __omp__::sequence supported in C
-#endif
-#else
-#ifdef __cplusplus
-#error __omp__::sequence not supported in C++
+#if !__has_attribute(__omp__::sequence)
+#error __omp__::sequence not supported in C/C++
 #endif
+
+#if !__has_attribute(omp::__decl__)
+#error omp::__decl__ not supported in C/C++
 #endif
 
 #if __has_attribute(omp::__unknown__)
 #error omp::__unknown__ supported
 #endif
 
-#if __has_cpp_attribute(__omp__::directive)
-#ifndef __cplusplus
-#error __omp__::directive supported in C
-#endif
-#else
-#ifdef __cplusplus
-#error __omp__::directive not supported in C++
-#endif
+#if !__has_cpp_attribute(__omp__::directive)
+#error __omp__::directive not supported in C/C++
 #endif
 
-#if __has_cpp_attribute(omp::__sequence__)
-#ifndef __cplusplus
-#error omp::__sequence__ supported in C
-#endif
-#else
-#ifdef __cplusplus
-#error omp::__sequence__ not supported in C++
+#if !__has_cpp_attribute(omp::__sequence__)
+#error omp::__sequence__ not supported in C/C++
 #endif
+
+#if !__has_cpp_attribute(__omp__::decl)
+#error __omp__::decl not supported in C/C++
 #endif
 
 #if __has_cpp_attribute(__omp__::unknown)
--- gcc/testsuite/c-c++-common/gomp/attrs-3.c.jj	2021-07-23 09:50:02.429080908 +0200
+++ gcc/testsuite/c-c++-common/gomp/attrs-3.c	2023-11-04 09:31:02.993715546 +0100
@@ -9,6 +9,10 @@
 #error omp::sequence supported even when -fno-openmp{,-simd}
 #endif
 
+#if __has_attribute(omp::decl)
+#error omp::decl supported even when -fno-openmp{,-simd}
+#endif
+
 #if __has_attribute(omp::unknown)
 #error omp::unknown supported
 #endif
@@ -21,6 +25,10 @@
 #error omp::sequence supported even when -fno-openmp{,-simd}
 #endif
 
+#if __has_cpp_attribute(omp::decl)
+#error omp::decl supported even when -fno-openmp{,-simd}
+#endif
+
 #if __has_cpp_attribute(omp::unknown)
 #error omp::unknown supported
 #endif
@@ -33,6 +41,10 @@
 #error __omp__::__sequence__ supported even when -fno-openmp{,-simd}
 #endif
 
+#if __has_attribute(__omp__::__decl__)
+#error __omp__::__decl__ supported even when -fno-openmp{,-simd}
+#endif
+
 #if __has_attribute(__omp__::__unknown__)
 #error __omp__::__unknown__ supported
 #endif
@@ -45,6 +57,10 @@
 #error __omp__::__sequence__ supported even when -fno-openmp{,-simd}
 #endif
 
+#if __has_cpp_attribute(__omp__::__decl__)
+#error __omp__::__decl__ supported even when -fno-openmp{,-simd}
+#endif
+
 #if __has_cpp_attribute(__omp__::__unknown__)
 #error __omp__::__unknown__ supported
 #endif
@@ -57,6 +73,10 @@
 #error __omp__::sequence supported even when -fno-openmp{,-simd}
 #endif
 
+#if __has_attribute(omp::__decl__)
+#error omp::__decl__ supported even when -fno-openmp{,-simd}
+#endif
+
 #if __has_attribute(omp::__unknown__)
 #error omp::__unknown__ supported
 #endif
@@ -69,6 +89,10 @@
 #error omp::__sequence__ supported even when -fno-openmp{,-simd}
 #endif
 
+#if __has_cpp_attribute(__omp__::decl)
+#error __omp__::decl supported even when -fno-openmp{,-simd}
+#endif
+
 #if __has_cpp_attribute(__omp__::unknown)
 #error __omp__::unknown supported
 #endif
