Landing: 3f14efbe47b0
Project / Subsystem
gcc / c++
Date
2026-07-13
Author
Jakub Jelinek
Commit
3f14efbe47b0607ca9c0fac6de7345733b084be6
Source
github
Perf win
No
Breaking
No
All attributes
- project
- gcc
- subsystem
- c++
- patch_id
- —
- commit_hash
- 3f14efbe47b0607ca9c0fac6de7345733b084be6
- source_type
- github
- headline
- Implement C++ attribute to prevent template specializations and new warning.
- tldr
- C++ compiler now supports `[[clang::no_specializations]]` attribute and `-Winvalid-specialization` warning.
- author
- Jakub Jelinek
- outcome
- committed
- performance_win
- false
- breaking_change
- false
- series_id
- —
- series_parts
- []
- tags
-
- • c++
- • language feature
- discussion_id_link
- —
- bugzilla_pr
- —
- date
- 2026-07-13T00:00:00.000Z
GCC now supports the [[clang::no_specializations]] attribute for class, variable, and function templates. Applying this attribute prevents any partial or full specialization of the template, issuing an error (which can be warned with -Winvalid-specialization). This feature is primarily intended for libraries like libstdc++ to help diagnose issues in standard library template usage and consistency.