Landing: b77cf8f055cc

Project / Subsystem

gcc / c++

Date

2026-07-15

Author

Jakub Jelinek

Commit

b77cf8f055cce3e42f09410cbbf1e4f1e196b25d

Source

github

Perf win

No

Breaking

No

All attributes

project
gcc
subsystem
c++
patch_id
commit_hash
b77cf8f055cce3e42f09410cbbf1e4f1e196b25d
source_type
github
headline
C++: In attributes expect _Clang namespace rather than __clang__
tldr
C++ attribute handling now prefers '_Clang::' over '__clang__::' for compatibility with Clang.
author
Jakub Jelinek
outcome
committed
performance_win
false
breaking_change
false
series_id
series_parts
[]
tags
  • c++
  • attributes
  • compatibility
discussion_id_link
bugzilla_pr
date
2026-07-15T00:00:00.000Z

GCC’s C++ frontend now better handles Clang’s attribute namespace syntax for improved compatibility. While Clang’s __clang__ macro means it uses _Clang::__attribute__ internally, GCC will now accept _Clang:: as the preferred namespace and warn if __clang__:: is used. This change also ensures correct behavior for __has_cpp_attribute and __has_attribute when targeting Clang-specific attributes.