Dev & Code 18 h agoAdd to bookmarks

A post promoted to the front page of Hacker News reminds us of a truth that many C++ developers prefer to ignore: neither GCC nor Clang implement 100% of the standard. Practical breakdown.
A post published on sebsite.pw and brought up on Hacker News reminds us of a truth that many C++ devs prefer to ignore: the two largest open-source compilers in the world, GCC (GNU Compiler Collection) and Clang (front-end of the LLVM project), are not fully compliant with the C++ standard. Neither has ever been 100% compliant.
The C++ standard (ISO/IEC 14882) is a tome of over 2,000 pages. Each new version (C++17, C++20, C++23, C++26 in preparation) adds features that implementers must catch up with. In practice, no compiler implements 100% of the standard on time; there are always "feature X partially supported" or "feature Y not implemented" in the compliance tables. The official and up-to-date list is available on cppreference.com (page "Compiler support").
The author of the post sheds light on a case where both GCC and Clang deviate from the standard: either they accept a program that the standard prohibits, or they reject a program that is perfectly compliant. The exact nature of the bug (frontend, ABI, optimizer) determines the impact - from "incorrect diagnosis" to "silently incorrect code".
For a senior dev, the question is therefore not whether his compiler is buggy - the answer is yes, like any software with 20+ million lines - but where the risk areas are, and which ones he encounters in practice.
-std=c++17 or by isolating the problematic construction until it is patched.The C++ standard is not the Bible, and compilers are not saints. If your code compiles on GCC 15 but not on Clang 20, there is nothing "miraculous" about it - just two implementations, two interpretations, one standard that is too big. Stay pragmatic, keep godbolt open.
Article produced by artificial intelligence, reviewed under human editorial control.