{"id":332463,"date":"2022-04-26T21:00:12","date_gmt":"2022-04-26T21:00:12","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=332463"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=332463","title":{"rendered":"<span>\u0412 \u0430\u043f\u0440\u0435\u043b\u0435 \u0432\u044b\u0439\u0434\u0435\u0442 GNU Compiler Collection 12<\/span>"},"content":{"rendered":"<div><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/642\/5e0\/69d\/6425e069d483cd8effc89dea9854aa9c.png\" width=\"960\" height=\"480\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/642\/5e0\/69d\/6425e069d483cd8effc89dea9854aa9c.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u0421\u043c\u044f\u0433\u0447\u0435\u043d\u0438\u0435 \u0443\u044f\u0437\u0432\u0438\u043c\u043e\u0441\u0442\u0438 Trojan Source, \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u0442\u0438\u043f\u043e\u0432, \u043c\u043d\u043e\u0433\u043e\u043c\u0435\u0440\u043d\u044b\u0439 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440 [], \u043f\u043e\u0434\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0439 \u043e \u0432\u0435\u043d\u0434\u043e\u0440\u043d\u044b\u0445 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0430\u0445 \u2014 \u0432\u043e\u0442 \u043b\u0438\u0448\u044c \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 GCC 12. \u041f\u043e\u0434\u0440\u043e\u0431\u043d\u043e\u0441\u0442\u044f\u043c\u0438 \u0434\u0435\u043b\u0438\u043c\u0441\u044f \u043a \u0441\u0442\u0430\u0440\u0442\u0443 <a href=\"https:\/\/skillfactory.ru\/c-plus-plus-razrabotchik?utm_source=habr&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=coding_cplus_260422&amp;utm_term=lead\">\u043a\u0443\u0440\u0441\u0430 \u043f\u043e \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u043d\u0430 C++<\/a>.<\/p>\n<hr\/>\n<p>\u0420\u0435\u043b\u0438\u0437 GNU GCC 12.1 (\u043f\u043e\u043b\u043d\u044b\u0439 \u0441\u043f\u0438\u0441\u043e\u043a \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439 <a href=\"https:\/\/gcc.gnu.org\/gcc-12\/changes.html\">\u0437\u0434\u0435\u0441\u044c<\/a>) \u0441\u043e\u0441\u0442\u043e\u0438\u0442\u0441\u044f \u0432 \u0430\u043f\u0440\u0435\u043b\u0435 2022 \u0433\u043e\u0434\u0430. \u0423\u0436\u0435 \u0441\u0435\u0439\u0447\u0430\u0441 GCC 12 \u2014 \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u0439 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u0432 Fedora 36, \u0438 \u043e\u043d \u0431\u0443\u0434\u0435\u0442 \u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d \u0432 Red Hat Enterprise Linux \u0432 Red Hat Developer Toolset 7 \u0438\u043b\u0438 Red Hat GCC Toolset 8 \u0438 9. \u042f \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443 \u0442\u043e\u043b\u044c\u043a\u043e \u043e \u043d\u043e\u0432\u044b\u0445 \u0444\u0438\u0447\u0430\u0445, \u0432\u043b\u0438\u044f\u044e\u0449\u0438\u0445 \u043d\u0430 C++.<\/p>\n<p>\u0414\u0438\u0430\u043b\u0435\u043a\u0442 GCC 12 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u2014 -std=gnu++17. C++23 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u043c -std=c++23; \u0444\u043b\u0430\u0433 -std=gnu++23 \u0432\u043a\u043b\u044e\u0447\u0430\u0435\u0442 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f GNU. C++20 \u0438 C++23 \u0432 GCC 12 \u043f\u043e-\u043f\u0440\u0435\u0436\u043d\u0435\u043c\u0443 \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u0430\u043b\u044c\u043d\u044b\u0435, \u0430 \u0432 \u0430\u043f\u0440\u0435\u043b\u044c\u0441\u043a\u043e\u043c GCC \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043e \u0435\u0449\u0451 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u0438\u0439 \u0438\u0437 \u0421++23.<\/p>\n<h3>if consteval<\/h3>\n<p>\u0412 C++17 \u043f\u043e\u044f\u0432\u0438\u043b\u0441\u044f \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440 constexpr if, \u0443\u0441\u043b\u043e\u0432\u0438\u0435 \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0434\u043e\u043b\u0436\u043d\u043e \u0431\u044b\u0442\u044c \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435\u043c-\u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u043e\u0439, (\u043e\u043d\u043e \u044f\u0432\u043d\u043e \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0435\u0442\u0441\u044f \u043a\u0430\u043a \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u0430). <\/p>\n<ul>\n<li>\n<p>\u0415\u0441\u043b\u0438 \u0443\u0441\u043b\u043e\u0432\u0438\u0435 \u0438\u0441\u0442\u0438\u043d\u043d\u043e, \u0432\u0435\u0442\u0432\u044c else \u043e\u0442\u0431\u0440\u0430\u0441\u044b\u0432\u0430\u0435\u0442\u0441\u044f, \u0442\u043e \u0435\u0441\u0442\u044c \u043d\u0435 \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438. <\/p>\n<\/li>\n<li>\n<p>\u0415\u0441\u043b\u0438 \u0443\u0441\u043b\u043e\u0432\u0438\u0435 \u043b\u043e\u0436\u043d\u043e, \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0430\u044f \u0432\u0435\u0442\u0432\u044c \u0442\u0430\u043a\u0436\u0435 \u043e\u0442\u0431\u0440\u0430\u0441\u044b\u0432\u0430\u0435\u0442\u0441\u044f.<\/p>\n<\/li>\n<li>\n<p>\u0415\u0441\u043b\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u0430 \u043a\u0430\u043a constexpr, \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438 \u043e\u043d\u0430 \u043c\u043e\u0436\u0435\u0442 \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0442\u044c\u0441\u044f \u0438\u043b\u0438 \u043d\u0435 \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0442\u044c\u0441\u044f \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0430. <\/p>\n<\/li>\n<\/ul>\n<p>\u0427\u0442\u043e\u0431\u044b \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u0438\u043c\u0435\u043b \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043e \u0442\u043e\u043c, \u043a\u043e\u0433\u0434\u0430 \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0435\u0442\u0441\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f, \u0432 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u0443\u044e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 C++20 \u0432\u0432\u0435\u0434\u0435\u043d\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044f std::is_constant_evaluated. \u041e\u043d\u0430 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 true, \u043a\u043e\u0433\u0434\u0430 \u0442\u0435\u043a\u0443\u0449\u0438\u0439 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442 \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0435\u0442\u0441\u044f \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438:<\/p>\n<pre><code class=\"cpp\">#include &lt;type_traits>  int slow (int);  constexpr int fn (int n) {   if (std::is_constant_evaluated ())     return n &lt;&lt; 1; \/\/ #1   else     return slow (n); \/\/ #2 }  constexpr int i = fn (10); \/\/ does #1 int n = 10; int i2 = fn (n); \/\/ calls slow function #2<\/code><\/pre>\n<p>\u0412 C++20 \u043f\u043e\u044f\u0432\u0438\u043b\u043e\u0441\u044c \u043a\u043b\u044e\u0447\u0435\u0432\u043e\u0435 \u0441\u043b\u043e\u0432\u043e consteval. \u0424\u0443\u043d\u043a\u0446\u0438\u044f, \u0444\u0443\u043d\u043a\u0446\u0438\u044f-\u0447\u043b\u0435\u043d \u0438\u043b\u0438 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440 \u0441 consteval \u2014 \u044d\u0442\u043e \u043d\u0435\u043c\u0435\u0434\u043b\u0435\u043d\u043d\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f (immediate function), \u0434\u043b\u044f \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u043d\u0435 \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u0442 \u043a\u043e\u0434. <\/p>\n<p>\u041d\u0435\u043c\u0435\u0434\u043b\u0435\u043d\u043d\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u044e\u0442\u0441\u044f \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438 \u0438 \u0434\u043e\u043b\u0436\u043d\u044b \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u0443, \u043a\u0440\u043e\u043c\u0435 \u0441\u043b\u0443\u0447\u0430\u0435\u0432, \u043a\u043e\u0433\u0434\u0430 \u0442\u0430\u043a\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0438\u0437 \u0434\u0440\u0443\u0433\u043e\u0439 \u043d\u0435\u043c\u0435\u0434\u043b\u0435\u043d\u043d\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u0430 \u0435\u0441\u043b\u0438 \u044d\u0442\u043e \u043d\u0435 \u0442\u0430\u043a, \u0442\u043e \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u0435\u0442 \u043e\u0448\u0438\u0431\u043a\u0430 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438.<\/p>\n<p>\u041a\u0430\u043a \u0431\u044b \u0442\u043e \u043d\u0438 \u0431\u044b\u043b\u043e, \u0432 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u043c \u0442\u0435\u0441\u0442\u0435 \u043f\u0440\u0430\u0432\u0438\u043b\u0430 \u044f\u0437\u044b\u043a\u0430 \u0437\u0430\u043f\u0440\u0435\u0449\u0430\u044e\u0442 \u0437\u0430\u043c\u0435\u043d\u0438\u0442\u044c n &lt;&lt; 1 \u0432\u044b\u0437\u043e\u0432\u043e\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u0438 consteval:<\/p>\n<pre><code class=\"cpp\">#include &lt;type_traits>  int slow (int); consteval int fast (int n) { return n &lt;&lt; 1; }  constexpr int fn (int n) {   if (std::is_constant_evaluated ())     return fast (n); \/\/ 'n' is not a constant expression   else     return slow (n); } constexpr int i = fn (10);<\/code><\/pre>\n<p>\u042d\u0442\u043e\u0442 \u043d\u0435\u0434\u043e\u0447\u0451\u0442 <a href=\"https:\/\/wg21.link\/p1938\">\u0438\u0441\u043f\u0440\u0430\u0432\u043b\u0435\u043d<\/a> \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u0438\u0435\u043c \u043e \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0438 if consteval, \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u043e\u043c \u0432 GCC 12. \u0421 \u043f\u043e\u043c\u043e\u0449\u044c\u044e if consteval \u0432\u044b\u0437\u044b\u0432\u0430\u0442\u044c \u043d\u0435\u043c\u0435\u0434\u043b\u0435\u043d\u043d\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043c\u043e\u0436\u043d\u043e \u0442\u0430\u043a:<\/p>\n<pre><code class=\"cpp\">#include &lt;type_traits>  int slow (int); consteval int fast (int n) { return n &lt;&lt; 1; }  constexpr int fn (int n) {   if consteval {     return fast (n); \/\/ OK   } else {     return slow (n);   } }  constexpr int i = fn (10);<\/code><\/pre>\n<blockquote>\n<p>if consteval \u0434\u043e\u043f\u0443\u0441\u0442\u0438\u043c\u043e \u0432 \u043e\u0431\u044b\u0447\u043d\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u0433\u0434\u0435 \u043d\u0435\u0442 constexpr. \u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, \u0432 \u043e\u0442\u043b\u0438\u0447\u0438\u0435 \u043e\u0442 \u043e\u0431\u044b\u0447\u043d\u043e\u0433\u043e if, \u0432 if consteval \u0444\u0438\u0433\u0443\u0440\u043d\u044b\u0435 \u0441\u043a\u043e\u0431\u043a\u0438 \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u044b.<\/p>\n<\/blockquote>\n<p>\u041f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f if constexpr \u0438 std::is_constant_evaluated, \u043a \u0441\u0447\u0430\u0441\u0442\u044c\u044e, \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u043e\u043c, \u0441\u043c\u043e\u0442\u0440\u0438\u0442\u0435 \u0440\u0430\u0437\u0434\u0435\u043b std::is_constant_evaluated \u0432 \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u044f\u0445 \u0434\u043b\u044f if.<\/p>\n<h4>auto(x)<\/h4>\n<p>GCC 12 <a href=\"https:\/\/wg21.link\/p0849\">\u0434\u043e\u043f\u0443\u0441\u043a\u0430\u0435\u0442<\/a> \u043a\u043b\u044e\u0447\u0435\u0432\u043e\u0435 \u0441\u043b\u043e\u0432\u043e auto \u0432 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u0438\u0438 \u0442\u0438\u043f\u043e\u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0441\u0442\u0438\u043b\u044f: auto <a href=\"https:\/\/en.cppreference.com\/w\/cpp\/language\/value_category\">\u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442\u0441\u044f<\/a> \u043a \u0447\u0438\u0441\u0442\u043e\u043c\u0443 rvalue.<\/p>\n<pre><code class=\"cpp\">struct A {}; void f(A&amp;);  \/\/ #1 void f(A&amp;&amp;); \/\/ #2 A&amp; g();  void h() {   f(g()); \/\/ calls #1   f(auto(g())); \/\/ calls #2 with a temporary object }<\/code><\/pre>\n<blockquote>\n<p>\u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435: \u0434\u043e\u043f\u0443\u0441\u0442\u0438\u043c\u044b auto(x) \u0438 auto{x}, \u043d\u043e \u043d\u0435 decltype(auto)(x).<\/p>\n<\/blockquote>\n<h4>\u041d\u0435\u043b\u0438\u0442\u0435\u0440\u0430\u043b\u044c\u043d\u044b\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u044f\u0445 constexpr<\/h4>\n<p>\u041a\u043e\u0433\u0434\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 constexpr \u043d\u0435 \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u044e\u0442\u0441\u044f \u043a\u0430\u043a \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u044b, GCC 12 <a href=\"https:\/\/wg21.link\/p2242\">\u0434\u043e\u043f\u0443\u0441\u043a\u0430\u0435\u0442<\/a> \u043d\u0435\u043b\u0438\u0442\u0435\u0440\u0430\u043b\u044c\u043d\u044b\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435, \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u044b goto \u0438 \u043c\u0435\u0442\u043a\u0438 \u0432 \u043d\u0438\u0445, \u0447\u0442\u043e \u043f\u043e\u043b\u0435\u0437\u043d\u043e \u0434\u043b\u044f \u043a\u043e\u0434\u0430, \u043f\u043e\u0434\u043e\u0431\u043d\u043e\u0433\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c\u0443 (\u0432\u0437\u044f\u0442 \u0438\u0437 \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u0438\u044f):<\/p>\n<pre><code class=\"cpp\">#include &lt;type_traits>  template&lt;typename T> constexpr bool f() {   if (std::is_constant_evaluated()) {     return true;   } else {     T t; \/\/ OK when T=nonliteral in C++23     return true;   } } struct nonliteral { nonliteral(); }; static_assert(f&lt;nonliteral>());<\/code><\/pre>\n<p>\u0422\u0430\u043a\u043e\u0439 \u043a\u043e\u0434 \u043d\u0435 \u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0432 C++20, \u043d\u043e \u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0432 C++23, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0432\u0435\u0442\u0432\u044c else \u043d\u0435 \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0435\u0442\u0441\u044f. \u0422\u0430\u043a\u0436\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0432 C++23 \u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u043f\u0440\u0438\u043c\u0435\u0440:<\/p>\n<pre><code class=\"cpp\">constexpr int foo (int i) {   if (i == 0)     return 42;   static int a;   thread_local int t;   goto label; label:   return 0; }<\/code><\/pre>\n<h4>\u041c\u043d\u043e\u0433\u043e\u043c\u0435\u0440\u043d\u044b\u0439 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440 []<\/h4>\n<p>\u0412 C++ \u0444\u0443\u043d\u043a\u0446\u0438\u044f-\u0447\u043b\u0435\u043d operator[] \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u043c \u043c\u0430\u0441\u0441\u0438\u0432\u0430 \u0438 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u043c \u0442\u0438\u043f\u043e\u0432, \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0445 \u043c\u0430\u0441\u0441\u0438\u0432\u0430\u043c, \u0442\u0430\u043a\u0438\u043c \u043a\u0430\u043a std::array, std::span, std::vector \u0438 std::string. GCC 12 <a href=\"https:\/\/wg21.link\/p2128\">\u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442<\/a> \u043c\u043d\u043e\u0433\u043e\u043c\u0435\u0440\u043d\u044b\u0439 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440 \u0438\u043d\u0434\u0435\u043a\u0441\u0430. \u0412\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0441 \u0437\u0430\u043f\u044f\u0442\u044b\u043c\u0438 \u0432 [] <a href=\"https:\/\/wg21.link\/p1161\">\u0443\u0441\u0442\u0430\u0440\u0435\u043b\u0438<\/a> \u0432 C++20, \u0430 \u0432 C++23 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0437\u0430\u043f\u044f\u0442\u043e\u0439 \u0432 [] \u0438\u0437\u043c\u0435\u043d\u0438\u043b\u043e\u0441\u044c.<\/p>\n<p>\u0412 C++20 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440 [] \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u043b \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u0438\u043d \u044d\u043b\u0435\u043c\u0435\u043d\u0442, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u043c \u043c\u043d\u043e\u0433\u043e\u043c\u0435\u0440\u043d\u044b\u0445 \u043c\u0430\u0441\u0441\u0438\u0432\u043e\u0432 \u043f\u043e\u043b\u0443\u0447\u0430\u043b\u0438 \u0447\u0435\u0440\u0435\u0437 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u044b \u0432\u044b\u0437\u043e\u0432\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u0439: arr(x, y, z), \u0438 \u043f\u043e\u0445\u043e\u0436\u0438\u0445 \u043e\u0431\u0445\u043e\u0434\u043d\u044b\u0445 \u043f\u0443\u0442\u0435\u0439, \u043d\u0435 \u043b\u0438\u0448\u0451\u043d\u043d\u044b\u0445 \u043d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043a\u043e\u0432. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 C++23 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u0443 [] \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0442\u044c \u043d\u043e\u043b\u044c \u0438\u043b\u0438 \u0431\u043e\u043b\u0435\u0435 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432, \u0430 \u0437\u043d\u0430\u0447\u0438\u0442,  \u043f\u0440\u0438 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438 \u0441 \u0444\u043b\u0430\u0433\u043e\u043c -std=c++23 \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u044d\u0442\u043e\u0442 \u043f\u0440\u0438\u043c\u0435\u0440:<\/p>\n<pre><code class=\"cpp\">template &lt;typename... T> struct W {   constexpr auto operator[](T&amp;&amp;...); };  W&lt;> w1; W&lt;int> w2; W&lt;int, int> w3;<\/code><\/pre>\n<p>\u041f\u043e\u043d\u044f\u0442\u043d\u0435\u0435 \u0431\u0443\u0434\u0435\u0442 \u044d\u0442\u043e\u0442 \u043a\u043e\u0434 \u0441 \u043a\u0440\u0430\u0439\u043d\u0435 \u043d\u0430\u0438\u0432\u043d\u043e\u0439 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0435\u0439:<\/p>\n<pre><code class=\"cpp\">struct S {   int a[64];   constexpr S () : a {} {};   constexpr S (int x, int y, int z) : a {x, y, z} {};   constexpr int &amp;operator[] () { return a[0]; }   constexpr int &amp;operator[] (int x) { return a[x]; }   constexpr int &amp;operator[] (int x, long y) { return a[x + y * 8]; } };  void g () {   S s;   s[] = 42;   s[5] = 36;   s[3, 4] = 72; }<\/code><\/pre>\n<p>\u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f GNU, \u0435\u0441\u043b\u0438 GCC \u043d\u0435 \u043d\u0430\u0445\u043e\u0434\u0438\u0442 \u043f\u0435\u0440\u0435\u0433\u0440\u0443\u0437\u043a\u0443 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u0430 [], \u0442\u043e \u0432\u0435\u0434\u0451\u0442 \u0441\u0435\u0431\u044f \u043a\u0430\u043a \u0440\u0430\u043d\u044c\u0448\u0435, \u043d\u043e \u0432\u044b\u0434\u0430\u0451\u0442 \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435:<\/p>\n<pre><code class=\"cpp\">void f(int a[], int b, int c) {   a[b,c]; \/\/ deprecated in C++20, invalid but accepted with a warning in C++23   a[(b,c)]; \/\/ OK in both C++20 and C++23  }<\/code><\/pre>\n<p>\u0423\u0447\u0442\u0438\u0442\u0435, \u0447\u0442\u043e operator[] \u043d\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u044b \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e, \u043d\u043e \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u0438\u0445 <a href=\"https:\/\/wg21.link\/cwg2507\">\u0440\u0430\u0437\u0440\u0435\u0448\u0430\u0442<\/a> \u043f\u043e\u0437\u0436\u0435. \u0415\u0441\u043b\u0438 \u0438 \u043a\u043e\u0433\u0434\u0430 \u044d\u0442\u043e \u0441\u043b\u0443\u0447\u0438\u0442\u0441\u044f, \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u043a\u043e\u0434 \u043d\u0438\u0436\u0435:<\/p>\n<pre><code class=\"cpp\">struct X {   int a[64];   constexpr int&amp; operator[](int i = 1) { return a[i]; } }; <\/code><\/pre>\n<h4>elifdef \u0438 elifndef<\/h4>\n<p>\u0412 C \u0438 C++ \u0434\u0438\u0440\u0435\u043a\u0442\u0438\u0432\u044b #ifdef \u0438 #ifndef \u2014 \u044d\u0442\u043e \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0441\u0430\u0445\u0430\u0440 \u0434\u043b\u044f #ifdefined(&#8230;) \u0438 #if !defined(&#8230;). \u0423\u0434\u0438\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e, \u043d\u043e \u0443 \u0434\u0440\u0443\u0433\u0438\u0445 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u043e\u0432 \u044d\u0442\u0438\u0445 \u0434\u0438\u0440\u0435\u043a\u0442\u0438\u0432 \u0442\u0430\u043a\u0438\u0445 \u0441\u043e\u043a\u0440\u0430\u0449\u0435\u043d\u0438\u0439 \u043d\u0435\u0442. \u0427\u0442\u043e\u0431\u044b \u0438\u0441\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u044d\u0442\u043e, \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 C \u0438 C++ \u043f\u0440\u0438\u043d\u044f\u043b\u0438 \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u0438\u044f <a href=\"http:\/\/www.open-std.org\/jtc1\/sc22\/wg14\/www\/docs\/n2645.pdf\">N2645<\/a> \u0438 <a href=\"https:\/\/wg21.link\/p2334\">P2334R1<\/a>. \u0412 GCC 12 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u044b \u043e\u0431\u0430 \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u043f\u0440\u0438\u043c\u0435\u0440 \u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u0443\u0435\u0442\u0441\u044f:<\/p>\n<pre><code class=\"cpp\">#ifdef __STDC__ \/* ... *\/ #elifndef __cplusplus #warning \"not ISO C\" #else \/* ... *\/ #endif<\/code><\/pre>\n<blockquote>\n<p>\u0414\u043b\u044f \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438 \u044d\u0442\u043e\u0433\u043e \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u0432 C++20 \u0438 \u0431\u043e\u043b\u0435\u0435 \u0440\u0430\u043d\u043d\u0438\u0445 \u0432\u0435\u0440\u0441\u0438\u044f\u0445 \u043d\u0443\u0436\u043d\u043e \u0432\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f GNU. \u0414\u0440\u0443\u0433\u0438\u043c\u0438 \u0441\u043b\u043e\u0432\u0430\u043c\u0438, \u0444\u043b\u0430\u0433 -std=c++20 \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442 \u043a \u043e\u0448\u0438\u0431\u043a\u0435 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438, \u0430 \u0441 \u0444\u043b\u0430\u0433\u0430\u043c\u0438 -std=gnu++20 \u0438 -Wpedantic \u2014 \u043a \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u044e \u0442\u0438\u043f\u0430 pedantic, \u0442\u043e \u0435\u0441\u0442\u044c \u043e \u043d\u0435\u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0438 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u0443 ISO.<\/p>\n<\/blockquote>\n<h4>\u041f\u0441\u0435\u0432\u0434\u043e\u043d\u0438\u043c\u044b \u0432 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u0435 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438<\/h4>\n<p>GCC 12 <a href=\"https:\/\/wg21.link\/p2360r0\">\u0440\u0430\u0437\u0440\u0435\u0448\u0430\u0435\u0442<\/a> \u043e\u0431\u044a\u044f\u0432\u043b\u044f\u0442\u044c \u043f\u0441\u0435\u0432\u0434\u043e\u043d\u0438\u043c\u044b \u0432 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u0435 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u043e\u043c \u0432\u043d\u0443\u0442\u0440\u0438 if, for \u0438 switch:<\/p>\n<pre><code class=\"cpp\">for (using T = int; T e : v)   {     \/\/ use e   }<\/code><\/pre>\n<h3>\u0418\u0441\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0438 \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0438\u0435 \u0443\u043b\u0443\u0447\u0448\u0435\u043d\u0438\u044f<\/h3>\n<p>\u0418\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0432 \u044d\u0442\u043e\u043c \u0440\u0430\u0437\u0434\u0435\u043b\u0435 \u0441\u043e\u0433\u043b\u0430\u0441\u0443\u044e\u0442 GCC \u0441 \u043d\u043e\u0432\u043e\u0432\u0432\u0435\u0434\u0435\u043d\u0438\u044f\u043c\u0438 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u0430 \u0438 \u0440\u0430\u0437\u0440\u0435\u0448\u0430\u044e\u0442 \u0440\u0430\u043d\u0435\u0435 \u043d\u0435\u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e\u0435 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435.<\/p>\n<h4>\u0418\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u043f\u043e\u0438\u0441\u043a\u0430 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0433\u043e \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u0430<\/h4>\n<p>\u0414\u043e GCC 12 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u043b \u043d\u0435\u043a\u0432\u0430\u043b\u0438\u0444\u0438\u0446\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043f\u043e\u0438\u0441\u043a \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0433\u043e \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u043d\u043e\u0433\u043e \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0448\u0430\u0431\u043b\u043e\u043d\u0430, \u0430 \u043d\u0435 \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u0438\u043d\u0441\u0442\u0430\u043d\u0446\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f. \u041f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435 GCC 12 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u043c\u0443 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u044e \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u044b\u0445 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0439 \u0432\u044b\u0437\u043e\u0432\u0430:<\/p>\n<pre><code class=\"cpp\">#include &lt;iostream>  namespace N {   struct A { }; }  void operator+(N::A, double) {   std::cout &lt;&lt; \"#1 \"; }  template&lt;class T> void f(T t) {   operator+(t, 0);   t + 0; }  \/\/ Since it's not visible from the template definition, this later-declared \/\/ operator overload should not be considered when instantiating f&lt;N::A>(N::A), \/\/ for either the call or operator expression. void operator+(N::A, int) {   std::cout &lt;&lt; \"#2 \"; }  int main() {   N::A a;   f(a);   std::cout &lt;&lt; std::endl; }<\/code><\/pre>\n<p>\u0412 GCC 11 \u0438 \u0441\u0442\u0430\u0440\u044b\u0445 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u0430\u0445 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430 \u0432\u044b\u0432\u0435\u0434\u0435\u0442 #1 #2, \u043d\u043e \u0432 GCC 12 \u2014 #1 #1: \u0440\u0430\u043d\u0435\u0435 \u0432 \u043f\u0435\u0440\u0435\u0433\u0440\u0443\u0437\u043a\u0443 \u0440\u0430\u0437\u0440\u0435\u0448\u0430\u043b\u043e\u0441\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0432\u044b\u0437\u043e\u0432\u0430 #1, \u0430 \u0432 GCC 12 \u0432 \u043f\u0435\u0440\u0435\u0433\u0440\u0443\u0437\u043a\u0443 \u0440\u0430\u0437\u0440\u0435\u0448\u0430\u0435\u0442\u0441\u044f \u0438 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u043d\u043e\u0435 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435.<\/p>\n<h4>\u0421\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440 auto \u0434\u043b\u044f \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u0435\u0439 \u0438 \u0441\u0441\u044b\u043b\u043e\u043a \u043d\u0430 \u043c\u0430\u0441\u0441\u0438\u0432\u044b<\/h4>\n<p>GCC 12 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0438\u0437 <a href=\"https:\/\/wg21.link\/cwg2397\">\u043e\u0442\u0447\u0451\u0442\u0430<\/a> \u043e \u0434\u0435\u0444\u0435\u043a\u0442\u0430\u0445 DR2397: \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440 auto \u0434\u043b\u044f \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u0435\u0439 \u0438 \u0441\u0441\u044b\u043b\u043e\u043a \u043d\u0430 \u043c\u0430\u0441\u0441\u0438\u0432\u044b, \u0438 \u0442\u0435\u043f\u0435\u0440\u044c \u0442\u0438\u043f \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 \u043c\u0430\u0441\u0441\u0438\u0432\u0430 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0442\u0438\u043f\u043e\u043c \u0441\u043e \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u043e\u043c auto, \u0442\u043e \u0435\u0441\u0442\u044c \u043a\u043e\u0434 \u043d\u0438\u0436\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442:<\/p>\n<pre><code class=\"cpp\">int a[3]; auto (*p)[3] = &amp;a; auto (&amp;r)[3] = a;<\/code><\/pre>\n<p>\u041d\u043e \u043c\u0430\u0441\u0441\u0438\u0432 \u0440\u0430\u0441\u043f\u0430\u0434\u0430\u0435\u0442\u0441\u044f \u043d\u0430 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u0432\u044b\u0432\u043e\u0434 \u0442\u0438\u043f\u0430 auto \u0437\u0434\u0435\u0441\u044c \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u0441 \u0442\u043e\u0447\u043a\u0438 \u0437\u0440\u0435\u043d\u0438\u044f \u0432\u044b\u0432\u043e\u0434\u0430 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0430 \u0448\u0430\u0431\u043b\u043e\u043d\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043d\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043d\u0438 \u043e\u0434\u0438\u043d \u0438\u0437 \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u043e\u0432 \u043d\u0438\u0436\u0435:<\/p>\n<pre><code class=\"cpp\">auto (&amp;&amp;r)[2] = { 1, 2 }; auto arr[2] = { 1, 2 };  int arr[5]; auto x[5] = arr;<\/code><\/pre>\n<p>\u0425\u043e\u0442\u044f \u043a\u043e\u0433\u0434\u0430-\u043d\u0438\u0431\u0443\u0434\u044c \u043e\u043d \u043c\u043e\u0436\u0435\u0442 \u0437\u0430\u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c.<\/p>\n<h4>\u0421\u0432\u0451\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u0435 \u0442\u0440\u0438\u0432\u0438\u0430\u043b\u044c\u043d\u044b\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439<\/h4>\n<p>std::move \u0438\u043b\u0438 std::forward \u2014 \u044d\u0442\u043e \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u0442\u0438\u043f\u043e\u0432, \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u043a\u0430\u043a \u0432\u044b\u0437\u043e\u0432\u044b \u0444\u0443\u043d\u043a\u0446\u0438\u0439, \u0442\u043e \u0435\u0441\u0442\u044c \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u0442 \u043e\u0442\u043b\u0430\u0434\u043e\u0447\u043d\u0443\u044e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e, \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u043c\u0443\u044e \u0434\u0430\u0436\u0435 \u043f\u043e\u0441\u043b\u0435 \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u043e\u0433\u043e \u0432\u044b\u0437\u043e\u0432\u0430, \u0445\u043e\u0442\u044f \u043e\u0442\u043b\u0430\u0436\u0438\u0432\u0430\u0442\u044c \u0442\u0430\u043a\u043e\u0439 \u043a\u043e\u0434 \u043d\u0435 \u043d\u0443\u0436\u043d\u043e. <\/p>\n<p>GCC 12 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u0443\u0435\u0442 \u0432\u044b\u0437\u043e\u0432\u044b \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0442\u0440\u0438\u0432\u0438\u0430\u043b\u044c\u043d\u044b\u0445 \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 std::move, std::forward, std::addressof \u0438 std::as_const) \u0432 \u043f\u0440\u043e\u0441\u0442\u044b\u0435 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u0442\u0438\u043f\u043e\u0432. \u042d\u0442\u043e \u0447\u0430\u0441\u0442\u044c \u043e\u0431\u0449\u0435\u0439 \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u044b \u0441\u0432\u0451\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u044f \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0439 \u043f\u0440\u0438 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u043e\u043c. <\/p>\n<p>\u0422\u0430\u043a \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043e\u0442\u043b\u0430\u0434\u043e\u0447\u043d\u043e\u0439 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 GCC \u043c\u043e\u0436\u0435\u0442 \u0441\u043e\u043a\u0440\u0430\u0442\u0438\u0442\u044c\u0441\u044f \u043d\u0430 10%, \u0442\u0430\u043a\u0436\u0435 \u0441\u043e\u043a\u0440\u0430\u0449\u0430\u044e\u0442\u0441\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u0430\u044f \u043f\u0430\u043c\u044f\u0442\u044c \u0438 \u0432\u0440\u0435\u043c\u044f \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438. \u041e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u044f \u0432\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0444\u043b\u0430\u0433\u043e\u043c -ffold-simple-inlines.<\/p>\n<h4>\u041e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f \u0432 \u0438\u0437\u043b\u0438\u0448\u043d\u0435 \u0441\u0432\u043e\u0431\u043e\u0434\u043d\u043e\u0439 \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 enum direct-list-initialization<\/h4>\n<p>GCC 12 \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u0442 <a href=\"https:\/\/wg21.link\/cwg2374\">\u043e\u0442\u0447\u0451\u0442 <\/a>\u043e \u0434\u0435\u0444\u0435\u043a\u0442\u0435, \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0437\u0430\u043f\u0440\u0435\u0449\u0430\u0435\u0442, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043f\u0440\u044f\u043c\u0443\u044e \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f \u0441 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u043d\u043e\u0439 \u043e\u0431\u043b\u0430\u0441\u0442\u044c\u044e \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0438\u0437 \u0434\u0440\u0443\u0433\u043e\u0433\u043e \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f \u044d\u0442\u043e\u0433\u043e \u0436\u0435 \u0442\u0438\u043f\u0430:<\/p>\n<pre><code class=\"cpp\">enum class Orange; enum class Apple; Orange o; Apple a{o}; \/\/ error with GCC 12<\/code><\/pre>\n<h4>\u041d\u0435\u0442\u0438\u043f\u043e\u0432\u044b\u0435 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u044b \u0448\u0430\u0431\u043b\u043e\u043d\u0430 \u0432 \u0447\u0430\u0441\u0442\u0438\u0447\u043d\u044b\u0445 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f\u0445<\/h4>\n<p>\u0420\u0430\u043d\u0435\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u0448\u0430\u0431\u043b\u043e\u043d\u0430 \u043a\u0430\u043a \u0435\u0433\u043e \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u0437\u0430\u043f\u0440\u0435\u0449\u0430\u043b\u043e\u0441\u044c. \u042d\u0442\u043e\u0442 \u0437\u0430\u043f\u0440\u0435\u0442 \u0441\u043d\u044f\u043b\u0438 \u0432 \u043e\u0442\u0432\u0435\u0442 \u043d\u0430 <a href=\"http:\/\/www.open-std.org\/jtc1\/sc22\/wg21\/docs\/cwg_defects.html#1315\">\u043e\u0442\u0447\u0451\u0442<\/a> \u043e \u0434\u0435\u0444\u0435\u043a\u0442\u0435. \u0421\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0435 \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430 \u0448\u0430\u0431\u043b\u043e\u043d\u0430 \u043a\u0430\u043a \u0435\u0433\u043e \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0430 \u0441\u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u0443\u0435\u0442\u0441\u044f:<\/p>\n<pre><code class=\"cpp\">template &lt;int I, int J> struct A {}; template &lt;int I> struct A&lt;I, I*2> {}; \/\/ OK with GCC 12<\/code><\/pre>\n<h4>\u041f\u043e\u0434\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u0432 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0432 \u043b\u0435\u043a\u0441\u0438\u0447\u0435\u0441\u043a\u043e\u043c \u043f\u043e\u0440\u044f\u0434\u043a\u0435<\/h4>\n<p>\u0412\u044b\u0432\u043e\u0434 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u0448\u0430\u0431\u043b\u043e\u043d\u0430 C++ \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0438\u0437\u043c\u0435\u043d\u0438\u043b\u0441\u044f, \u043a\u043e\u0433\u0434\u0430 \u0432 <a href=\"http:\/\/www.open-std.org\/jtc1\/sc22\/wg21\/docs\/cwg_defects.html#1227\">\u043e\u0442\u0447\u0451\u0442\u0435<\/a> \u0443\u043a\u0430\u0437\u0430\u043b\u0438, \u0447\u0442\u043e \u043f\u043e\u0434\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f, \u0441\u043b\u0435\u0432\u0430 \u043d\u0430\u043f\u0440\u0430\u0432\u043e, \u0442\u043e \u0435\u0441\u0442\u044c \u0432 \u043b\u0435\u043a\u0441\u0438\u0447\u0435\u0441\u043a\u043e\u043c \u043f\u043e\u0440\u044f\u0434\u043a\u0435, \u0438\u0437-\u0437\u0430 \u0447\u0435\u0433\u043e \u043c\u043e\u0436\u0435\u0442 \u0432\u043e\u0437\u043d\u0438\u043a\u043d\u0443\u0442\u044c \u043d\u0435\u0436\u0435\u043b\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u044d\u0444\u0444\u0435\u043a\u0442:<\/p>\n<pre><code class=\"cpp\">template &lt;typename T> struct A { using type = typename T::type; };  template &lt;typename T> void g(T, typename A&lt;T>::type); template &lt;typename T> long g(...);  long y = g&lt;void>(0, 0); \/\/ OK in GCC 12, error in GCC 11  template &lt;class T> void h(typename A&lt;T>::type, T); template &lt;class T> long h(...);  long z = h&lt;void>(0, 0); \/\/ error in GCC 12, OK in GCC 11<\/code><\/pre>\n<p>GCC 12 \u043f\u043e\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u044b \u0441\u043b\u0435\u0432\u0430 \u043d\u0430\u043f\u0440\u0430\u0432\u043e, \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u044f \u043e\u0448\u0438\u0431\u043a\u0443 \u0442\u0438\u043f\u0430 \u0434\u043e \u043f\u043e\u0434\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u043e\u0441\u0442\u0430\u0432\u0448\u0438\u0445\u0441\u044f \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432. \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0434\u043b\u044f g&lt;void>(0, 0) \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u043f\u044b\u0442\u0430\u0435\u0442\u0441\u044f \u043f\u043e\u0434\u0441\u0442\u0430\u0432\u0438\u0442\u044c void \u0432 g(T, typename A&lt;T>::type) \u0438 \u0432\u0438\u0434\u0438\u0442, \u0447\u0442\u043e \u043f\u0435\u0440\u0432\u0430\u044f \u0437\u0430\u043c\u0435\u043d\u0430 \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442 \u043a \u043d\u0435\u0434\u043e\u043f\u0443\u0441\u0442\u0438\u043c\u043e\u043c\u0443 \u0434\u043b\u044f \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430 \u0442\u0438\u043f\u0443 void.<\/p>\n<p>\u042d\u0442\u0430 \u0437\u0430\u043c\u0435\u043d\u0430 \u2014 SFINAE (\u00ab\u043d\u0435\u0443\u0434\u0430\u0447\u043d\u0430\u044f \u043f\u043e\u0434\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u2014 \u043d\u0435 \u043e\u0448\u0438\u0431\u043a\u0430\u00bb), \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0432\u043c\u0435\u0441\u0442\u043e \u043f\u0435\u0440\u0432\u043e\u0439 \u043f\u0435\u0440\u0435\u0433\u0440\u0443\u0437\u043a\u0438, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043e\u0442\u0431\u0440\u0430\u0441\u044b\u0432\u0430\u0435\u0442\u0441\u044f, \u0432\u044b\u0431\u0438\u0440\u0430\u0435\u0442\u0441\u044f g(&#8230;). \u041d\u043e \u0434\u043b\u044f h&lt;void>(0, 0) \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u0432 typename A&lt;T>::type \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u043f\u043e\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 void. \u0418 \u044d\u0442\u043e \u0441\u0435\u0440\u044c\u0451\u0437\u043d\u0430\u044f \u043e\u0448\u0438\u0431\u043a\u0430, \u0432\u0435\u0434\u044c \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u0430 A \u043d\u0435 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u043c \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u043e\u043c. <\/p>\n<p>GCC 11 \u0438 \u0431\u043e\u043b\u0435\u0435 \u0440\u0430\u043d\u043d\u0438\u0435 \u0432\u0435\u0440\u0441\u0438\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u043b\u0438 \u044d\u0442\u0443 \u0437\u0430\u043c\u0435\u043d\u0443 \u0441\u043f\u0440\u0430\u0432\u0430 \u043d\u0430\u043b\u0435\u0432\u043e, \u043f\u0440\u0438\u0432\u043e\u0434\u044f \u043a \u043e\u0431\u0440\u0430\u0442\u043d\u043e\u043c\u0443: g&lt;void>(0, 0) \u0432\u044b\u0437\u044b\u0432\u0430\u043b\u043e \u043e\u0448\u0438\u0431\u043a\u0443 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438, \u0442\u043e\u0433\u0434\u0430 \u043a\u0430\u043a h&lt;void>(0, 0) \u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u043b\u043e\u0441\u044c.<\/p>\n<h4>\u0411\u043e\u043b\u0435\u0435 \u0441\u0442\u0440\u043e\u0433\u0430\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u043e\u0432 \u0432 \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u0438\u044f\u0445 friend<\/h4>\n<p>\u041e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u0438\u0435 friend \u0441 \u043b\u044e\u0431\u044b\u043c \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u043e\u043c \u0434\u043e\u043b\u0436\u043d\u043e \u0431\u044b\u0442\u044c \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435\u043c, \u043d\u043e \u0434\u043e \u0432\u0435\u0440\u0441\u0438\u0438 12 GCC \u043d\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u043b \u044d\u0442\u043e \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0435. \u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, \u0430\u0442\u0440\u0438\u0431\u0443\u0442 C++11 \u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u044c\u0441\u044f \u0432 \u0441\u0435\u0440\u0435\u0434\u0438\u043d\u0435 decl-specifier-seq:<\/p>\n<pre><code class=\"cpp\">template&lt;typename T> struct S {   [[deprecated]] friend T; \/\/ warning: attribute ignored   [[deprecated]] friend void f(); \/\/ warning: attribute ignored   friend [[deprecated]] int f2(); \/\/ error }; S&lt;int> s;<\/code><\/pre>\n<h4>\u0414\u0435\u0434\u0443\u043a\u0442\u0438\u0432\u043d\u044b\u0435 \u0440\u0443\u043a\u043e\u0432\u043e\u0434\u0441\u0442\u0432\u0430 (deduction guides) \u0442\u0435\u043f\u0435\u0440\u044c \u043c\u043e\u0433\u0443\u0442 \u043e\u0431\u044a\u044f\u0432\u043b\u044f\u0442\u044c\u0441\u044f \u0432 \u043e\u0431\u043b\u0430\u0441\u0442\u0438 \u0432\u0438\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u043a\u043b\u0430\u0441\u0441\u0430<\/h4>\n<p>\u0418\u0437-\u0437\u0430 \u0431\u0430\u0433\u0430 \u0432 \u0432\u0435\u0440\u0441\u0438\u044f\u0445 GCC \u0434\u043e 11 \u0432\u043a\u043b\u044e\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0434\u0435\u0434\u0443\u043a\u0442\u0438\u0432\u043d\u044b\u0435 \u0440\u0443\u043a\u043e\u0432\u043e\u0434\u0441\u0442\u0432\u0430 \u043d\u0435\u043b\u044c\u0437\u044f \u0431\u044b\u043b\u043e \u043e\u0431\u044a\u044f\u0432\u0438\u0442\u044c \u043d\u0430 \u0443\u0440\u043e\u0432\u043d\u0435 \u043a\u043b\u0430\u0441\u0441\u0430. \u041e\u0448\u0438\u0431\u043a\u0430 <a href=\"https:\/\/gcc.gnu.org\/PR79501\">\u0438\u0441\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0430<\/a> \u0432 GCC 12, \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u043a\u043e\u0434 \u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u0443\u0435\u0442\u0441\u044f:<\/p>\n<pre><code class=\"cpp\">struct X {   template&lt;typename T> struct A {};   A() -> A&lt;int>; };<\/code><\/pre>\n<p>GCC 12 \u0442\u0430\u043a\u0436\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u0440\u0443\u043a\u043e\u0432\u043e\u0434\u0441\u0442\u0432\u0430 \u043f\u043e \u0434\u0435\u0434\u0443\u043a\u0446\u0438\u044f\u043c \u0431\u0435\u0437 \u0448\u0430\u0431\u043b\u043e\u043d\u043e\u0432 \u043d\u0430 \u0443\u0440\u043e\u0432\u043d\u0435 \u043a\u043b\u0430\u0441\u0441\u0430.<\/p>\n<h4>C\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435 \u043d\u0443\u043b\u0435\u0432\u044b\u0445 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u0435\u0439 \u0442\u0435\u043f\u0435\u0440\u044c \u043e\u0442\u043a\u043b\u043e\u043d\u044f\u0435\u0442\u0441\u044f<\/h4>\n<p>\u0421\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435 \u0442\u0438\u043f\u0430 \u0431\u043e\u043b\u044c\u0448\u0435-\u043c\u0435\u043d\u044c\u0448\u0435 \u043c\u0435\u0436\u0434\u0443 \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u0430\u043c\u0438 \u043d\u0443\u043b\u0435\u0432\u043e\u0433\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044f \u0438 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044f\u043c\u0438 \u0438\u043c\u0435\u044e\u0442 \u043d\u0435\u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u0439 \u0444\u043e\u0440\u043c\u0430\u0442, \u0447\u0442\u043e \u0434\u0438\u0430\u0433\u043d\u043e\u0441\u0442\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0432 GCC 12:<\/p>\n<pre><code class=\"cpp\">decltype(nullptr) foo (); auto cmp = foo () > 0; \/\/ error: ordered comparison of pointer with integer zero<\/code><\/pre>\n<p>\u041e\u0431\u0449\u0438\u0439 \u0441\u0442\u0430\u0442\u0443\u0441 \u0443\u0441\u0442\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0434\u0435\u0444\u0435\u043a\u0442\u043e\u0432 \u0443\u043a\u0430\u0437\u0430\u043d \u043d\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435 <a href=\"https:\/\/gcc.gnu.org\/projects\/cxx-dr-status.html\">C++ Defect Report Support in GCC<\/a>.<\/p>\n<h3>\u041d\u043e\u0432\u044b\u0435 \u0438 \u0434\u043e\u0440\u0430\u0431\u043e\u0442\u0430\u043d\u043d\u044b\u0435 \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u044f<\/h3>\n<p>\u0412 GCC 12 \u0434\u043e\u0440\u0430\u0431\u043e\u0442\u0430\u043b\u0438 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0439:<\/p>\n<h4>-Wuninitialized<\/h4>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c -Wuninitialized \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0430\u0435\u0442 \u043e\u0431 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 \u043d\u0435\u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u0432 \u0441\u043f\u0438\u0441\u043a\u0430\u0445 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u043e\u0432 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432, \u0430 \u0437\u043d\u0430\u0447\u0438\u0442, \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0438\u0440\u0443\u044e\u0449\u0438\u0439 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u043c\u043e\u0436\u0435\u0442 \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0438\u0432\u0430\u0442\u044c \u0442\u0430\u043a\u0438\u0435 \u043e\u0448\u0438\u0431\u043a\u0438:<\/p>\n<pre><code class=\"cpp\">struct A {   int a;   int b;   A() : b(1), a(b) { } };<\/code><\/pre>\n<p>\u0417\u0434\u0435\u0441\u044c \u043f\u043e\u043b\u0435 b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043d\u0435\u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u043c: \u043f\u043e\u0440\u044f\u0434\u043e\u043a \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u043e\u0432 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u0432 \u0441\u043f\u0438\u0441\u043a\u0435 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u043e\u0432 \u043d\u0435 \u0432\u0430\u0436\u0435\u043d, \u043d\u043e \u0432\u0430\u0436\u0435\u043d \u043f\u043e\u0440\u044f\u0434\u043e\u043a \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u0438\u0439 \u0432 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0438 \u043a\u043b\u0430\u0441\u0441\u0430. \u0414\u043b\u044f \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u044f, \u043a\u043e\u0433\u0434\u0430 \u043f\u043e\u0440\u044f\u0434\u043e\u043a \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u043e\u0432 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u043d\u0435 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u043f\u043e\u0440\u044f\u0434\u043a\u0443 \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u0438\u044f, \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c -Wreorder.<\/p>\n<p>-Wuninitialized \u043d\u0435 \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0430\u0435\u0442 \u043e \u0431\u043e\u043b\u0435\u0435 \u0441\u043b\u043e\u0436\u043d\u044b\u0445 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u0430\u0445 \u0438 \u043e\u0431 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 \u0430\u0434\u0440\u0435\u0441\u0430 \u043e\u0431\u044a\u0435\u043a\u0442\u0430:<\/p>\n<pre><code class=\"cpp\">struct B {   int &amp;r;   int *p;   int a;   B() : r(a), p(&amp;a), a(1) { } \/\/ no warning };<\/code><\/pre>\n<p>\u041a\u0441\u0442\u0430\u0442\u0438, \u0437\u0430\u043f\u0440\u043e\u0441 \u043d\u0430 \u0443\u0441\u0438\u043b\u0435\u043d\u0438\u0435 \u044d\u0442\u043e\u0433\u043e \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u044f \u043f\u043e\u0441\u0442\u0443\u043f\u0438\u043b \u043e\u043a\u043e\u043b\u043e 17 \u043b\u0435\u0442 \u043d\u0430\u0437\u0430\u0434. \u0412\u0438\u0434\u0438\u043c\u043e, \u0438\u043d\u043e\u0433\u0434\u0430 \u0447\u0442\u043e-\u0442\u043e \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u0432\u0440\u0435\u043c\u0435\u043d\u0438.<\/p>\n<h4>-Wbidi-chars<\/h4>\n<p>-Wbidi-chars \u0434\u043e\u043b\u0436\u043d\u043e \u0441\u043c\u044f\u0433\u0447\u0438\u0442\u044c <a href=\"https:\/\/nvd.nist.gov\/vuln\/detail\/CVE-2021-42574\">CVE-2021-42574<\/a>, \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u0443\u044e \u043a\u0430\u043a <a href=\"https:\/\/trojansource.codes\/\">Trojan Source<\/a>. \u041e\u043d\u043e \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0430\u0435\u0442 \u043e \u0434\u0432\u0443\u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u043d\u044b\u0445 \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u044e\u0449\u0438\u0445 \u0441\u0438\u043c\u0432\u043e\u043b\u0430\u0445 UTF-8, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0433\u0443\u0442 \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043f\u0438\u0441\u044c\u043c\u0430 \u0441\u043b\u0435\u0432\u0430 \u043d\u0430\u043f\u0440\u0430\u0432\u043e \u043d\u0430 \u0441\u043f\u0440\u0430\u0432\u0430 \u043d\u0430\u043b\u0435\u0432\u043e \u0438 \u043d\u0430\u043e\u0431\u043e\u0440\u043e\u0442. <\/p>\n<p>\u041d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043a\u043e\u043c\u0431\u0438\u043d\u0430\u0446\u0438\u0438 \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u044e\u0449\u0438\u0445 \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432 \u043c\u043e\u0433\u0443\u0442 \u0437\u0430\u043f\u0443\u0442\u0430\u0442\u044c \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442\u0430: \u043a\u043e\u0434, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043a\u0430\u0436\u0435\u0442\u0441\u044f \u0437\u0430\u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u043c, \u043d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 \u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u0443\u0435\u0442\u0441\u044f, \u0438\u043b\u0438 \u043d\u0430\u043e\u0431\u043e\u0440\u043e\u0442. \u0427\u0442\u043e\u0431\u044b \u0443\u0437\u043d\u0430\u0442\u044c \u0431\u043e\u043b\u044c\u0448\u0435, \u0441\u043c\u043e\u0442\u0440\u0438\u0442\u0435 \u0441\u0442\u0430\u0442\u044c\u044e \u0414\u044d\u0432\u0438\u0434\u0430 \u041c\u0430\u043b\u043a\u043e\u043b\u044c\u043c\u0430 <a href=\"https:\/\/developers.redhat.com\/articles\/2022\/01\/12\/prevent-trojan-source-attacks-gcc-12\">Prevent Trojan Source attacks with GCC 12<\/a> \u043d\u0430 Red Hat Developer.<\/p>\n<h4>-Warray-compare<\/h4>\n<p>\u041d\u043e\u0432\u0430\u044f \u043e\u043f\u0446\u0438\u044f -Warray-compare \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0430\u0435\u0442 \u043e\u0431 \u0443\u0441\u0442\u0430\u0440\u0435\u0432\u0448\u0435\u043c \u0432 C++20 \u0441\u043f\u043e\u0441\u043e\u0431\u0435 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044f \u043c\u0430\u0441\u0441\u0438\u0432\u043e\u0432:<\/p>\n<pre><code class=\"cpp\">int arr1[5]; int arr2[5]; bool same = arr1 == arr2; \/\/ warning: comparison between two arrays<\/code><\/pre>\n<h4>-Wattributes<\/h4>\n<p>\u041e\u043f\u0446\u0438\u0438 -Wno-attributes=ns::attr \u0438 -Wno-attributes=ns:: \u043f\u043e\u0434\u0430\u0432\u043b\u044f\u044e\u0442 \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u044f \u043e \u043d\u0435\u0438\u0437\u0432\u0435\u0441\u0442\u043d\u044b\u0445 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0430\u0445 \u043e\u0431\u043b\u0430\u0441\u0442\u0438 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0432 C++11 \u0438 C2X. \u0422\u0430\u043a\u0436\u0435 \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c #pragma GCC Diagnostic ignored_attributes &#171;ns::attr&#187;. <\/p>\n<p>\u041d\u043e\u0432\u043e\u0435 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0438\u0442 \u043e\u043f\u0435\u0447\u0430\u0442\u043a\u0438 \u0438 \u0443\u0441\u0442\u0440\u0430\u043d\u0438\u0442 \u043d\u0435\u0436\u0435\u043b\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u044f \u043e \u0432\u0435\u043d\u0434\u043e\u0440\u043d\u044b\u0445 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0430\u0445:<\/p>\n<pre><code class=\"cpp\">[[deprecate]] void g(); \/\/ warning: should be deprecated [[company::attr]] void f(); \/\/ no warning<\/code><\/pre>\n<p>\u041f\u0440\u0438 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438 \u0441 \u0444\u043b\u0430\u0433\u043e\u043c -Wno-attributes=company:: \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 \u0432\u044b\u0437\u043e\u0432\u0435\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0435\u0440\u0432\u043e\u0435 \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u0438\u0435.<\/p>\n<h4>\u041d\u043e\u0432\u044b\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0439 \u043e \u043d\u0435\u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0438 \u0432\u0435\u0440\u0441\u0438\u0439 \u044f\u0437\u044b\u043a\u0430<\/h4>\n<p>\u041f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0432 GCC 12 \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u044b \u044d\u0442\u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0439:<\/p>\n<ul>\n<li>\n<p>-Wc++11-extensions<\/p>\n<\/li>\n<li>\n<p>-Wc++14-extensions<\/p>\n<\/li>\n<li>\n<p>-Wc++17-extensions<\/p>\n<\/li>\n<li>\n<p>-Wc++20-extensions<\/p>\n<\/li>\n<li>\n<p>-Wc++23-extensions<\/p>\n<\/li>\n<\/ul>\n<p>\u042d\u0442\u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u044e\u0442 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u043c\u0438 \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u044f\u043c\u0438 pedantic \u043e \u043f\u043e\u044f\u0432\u043b\u0435\u043d\u0438\u0438 \u043d\u043e\u0432\u044b\u0445 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0439 C++ \u0432 \u043a\u043e\u0434\u0435 \u043f\u043e \u0441\u0442\u0430\u0440\u043e\u043c\u0443 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u0443. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043d\u043e\u0432\u044b\u043c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u043c -Wno-c++11-extensions \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0434\u0430\u0432\u043b\u044f\u0442\u044c \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u044f \u043e\u0431 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 \u0432\u0430\u0440\u0438\u0430\u0442\u0438\u0432\u043d\u044b\u0445 \u0448\u0430\u0431\u043b\u043e\u043d\u043e\u0432 \u0432 \u043a\u043e\u0434\u0435 C++98.<\/p>\n<h4>std::is_constant_evaluated \u0432 \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u044f\u0445 \u0434\u043b\u044f if<\/h4>\n<p>\u0423\u0441\u043b\u043e\u0432\u0438\u0435 \u0432 if constexpr \u044f\u0432\u043d\u043e \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u044e\u0442\u0441\u044f \u043a\u0430\u043a \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u0430, \u0430 \u0437\u043d\u0430\u0447\u0438\u0442, if constexpr (std::is_constant_evaluated()) \u2014 \u0432\u0441\u0435\u0433\u0434\u0430 true. \u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 \u043f\u043e\u044f\u0432\u0438\u043b\u043e\u0441\u044c \u0432 GCC 10, GCC 12 \u0440\u0430\u0441\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0438\u043b \u0435\u0433\u043e \u043d\u0430 \u0441\u043e\u043c\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0441\u043b\u0443\u0447\u0430\u0438:<\/p>\n<pre><code class=\"cpp\">#include &lt;type_traits>  int foo () {   if (std::is_constant_evaluated ()) \/\/ warning: always evaluates to false in a non-constexpr function     return 1;   return 0; }  consteval int baz () {   if (std::is_constant_evaluated ()) \/\/ warning: always evaluates to true in a consteval function     return 1;   return 0; }<\/code><\/pre>\n<h4>-Wmissing-requires<\/h4>\n<p>\u041e\u043f\u0446\u0438\u044f -Wmissing-requires \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0430\u0435\u0442 \u043e \u043f\u0440\u043e\u043f\u0443\u0449\u0435\u043d\u043d\u044b\u0445 requires:<\/p>\n<pre><code class=\"cpp\">template &lt;typename T> concept Foo = __is_same(T, int);  template&lt;typename Seq> concept Sequence = requires (Seq s) {   \/* requires *\/ Foo&lt;Seq>; };<\/code><\/pre>\n<p>\u0420\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a, \u0432\u0438\u0434\u0438\u043c\u043e, \u0445\u043e\u0442\u0435\u043b \u0432\u044b\u0437\u0432\u0430\u0442\u044c \u043a\u043e\u043d\u0446\u0435\u043f\u0442 Foo (\u0432\u043b\u043e\u0436\u0435\u043d\u043d\u043e\u0435 requires), \u043f\u0435\u0440\u0435\u0434 \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u0434\u043e\u043b\u0436\u043d\u043e \u0441\u0442\u043e\u044f\u0442\u044c \u043a\u043b\u044e\u0447\u0435\u0432\u043e\u0435 \u0441\u043b\u043e\u0432\u043e requires. \u0412 \u044d\u0442\u043e\u043c \u0442\u0435\u0441\u0442\u0435 Foo \u2014 \u044d\u0442\u043e \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440-\u043a\u043e\u043d\u0446\u0435\u043f\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0434\u0435\u043b\u0430\u0435\u0442 Sequence \u0438\u0441\u0442\u0438\u043d\u043d\u044b\u043c, \u0435\u0441\u043b\u0438 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435 Foo \u0432\u0430\u043b\u0438\u0434\u043d\u043e\u0435. \u0412\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435 Foo \u0441\u043f\u0440\u0430\u0432\u0435\u0434\u043b\u0438\u0432\u043e \u0434\u043b\u044f \u0432\u0441\u0435\u0445 Seq.<\/p>\n<h4>-Waddress<\/h4>\n<p>-Waddress \u0442\u0435\u043f\u0435\u0440\u044c \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0430\u0435\u0442, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043e \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0438 \u0430\u0434\u0440\u0435\u0441\u0430 \u043d\u0435\u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438-\u0447\u043b\u0435\u043d\u0430 \u0441 nullptr:<\/p>\n<pre><code class=\"cpp\">struct S {   void f(); };  int g() {   if (&amp;S::f == nullptr) \/\/ warning: the address &amp;S::f will never be NULL     return -1;   return 0; }<\/code><\/pre>\n<h3>\u0411\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u043d\u043e\u0441\u0442\u0438<\/h3>\n<p>\u041a\u0430\u043a \u0438 \u0432\u0441\u0435\u0433\u0434\u0430, \u044f \u0445\u043e\u0442\u0435\u043b \u0431\u044b \u043f\u043e\u0431\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u0438\u0442\u044c \u0441\u0432\u043e\u0438\u0445 \u043a\u043e\u043b\u043b\u0435\u0433 \u0438\u0437 Red Hat, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0441\u0434\u0435\u043b\u0430\u043b\u0438 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 GNU C++ \u043d\u0430\u043c\u043d\u043e\u0433\u043e \u043b\u0443\u0447\u0448\u0435, \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u0414\u0436\u0435\u0439\u0441\u043e\u043d\u0430 \u041c\u0435\u0440\u0440\u0438\u043b\u043b\u0430, \u042f\u043a\u0443\u0431\u0430 \u0415\u043b\u0438\u043d\u0435\u043a\u0430, \u041f\u0430\u0442\u0440\u0438\u043a\u0430 \u041f\u0430\u043b\u043a\u0443 \u0438 \u0414\u0436\u043e\u043d\u0430\u0442\u0430\u043d\u0430 \u0423\u044d\u0439\u043a\u043b\u0438.<\/p>\n<h3>\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h3>\n<p>\u0412 GCC 13 \u043c\u044b \u043f\u043b\u0430\u043d\u0438\u0440\u0443\u0435\u043c \u0434\u043e\u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u043e\u0441\u0442\u0430\u0432\u0448\u0438\u0435\u0441\u044f \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0438 C++23, \u0441\u043c. \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0443 <a href=\"https:\/\/gcc.gnu.org\/projects\/cxx-status.html#cxx23\">C++23 Language Features<\/a> \u043d\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435 <a href=\"https:\/\/gcc.gnu.org\/projects\/cxx-status.html\">C++ Standards Support in GC\u0421<\/a>. <a href=\"https:\/\/gcc.gnu.org\/bugs\/\">\u041e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0439\u0442\u0435<\/a> \u043e\u0442\u0447\u0451\u0442\u044b \u043e\u0431 \u043e\u0448\u0438\u0431\u043a\u0430\u0445 \u0438 \u043d\u0435 \u0441\u0442\u0435\u0441\u043d\u044f\u0439\u0442\u0435\u0441\u044c \u043f\u043e\u043c\u043e\u0433\u0430\u0442\u044c \u0434\u0435\u043b\u0430\u0442\u044c GCC \u0435\u0449\u0451 \u043b\u0443\u0447\u0448\u0435.<\/p>\n<p>\u0410 \u043c\u044b \u043f\u043e\u043c\u043e\u0436\u0435\u043c \u043f\u0440\u043e\u043a\u0430\u0447\u0430\u0442\u044c \u0432\u0430\u0448\u0438 \u043d\u0430\u0432\u044b\u043a\u0438 \u0438\u043b\u0438 \u0441 \u0441\u0430\u043c\u043e\u0433\u043e \u043d\u0430\u0447\u0430\u043b\u0430 \u043e\u0441\u0432\u043e\u0438\u0442\u044c \u043f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u044e, \u0432\u043e\u0441\u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u043d\u0443\u044e \u0432 \u043b\u044e\u0431\u043e\u0435 \u0432\u0440\u0435\u043c\u044f:<\/p>\n<ul>\n<li>\n<p><a href=\"https:\/\/skillfactory.ru\/c-plus-plus-razrabotchik?utm_source=habr&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=coding_cplus_260422&amp;utm_term=conc\">\u041f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u044f C++ \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/skillfactory.ru\/python-fullstack-web-developer?utm_source=habr&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=coding_fpw_260422&amp;utm_term=conc\">\u041f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u044f Fullstack-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u043d\u0430 Python<\/a><\/p>\n<\/li>\n<\/ul>\n<p>\u0412\u044b\u0431\u0440\u0430\u0442\u044c \u0434\u0440\u0443\u0433\u0443\u044e <a href=\"https:\/\/skillfactory.ru\/catalogue?utm_source=habr&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=sf_allcourses_260422&amp;utm_term=conc\">\u0432\u043e\u0441\u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u043d\u0443\u044e \u043f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u044e<\/a>.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/2f9\/93b\/4df\/2f993b4df3a0d1787c30e6a605fe370f.png\" width=\"1000\" height=\"200\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/2f9\/93b\/4df\/2f993b4df3a0d1787c30e6a605fe370f.png\"\/><figcaption><\/figcaption><\/figure>\n<details class=\"spoiler\">\n<summary>\u041a\u0440\u0430\u0442\u043a\u0438\u0439 \u043a\u0430\u0442\u0430\u043b\u043e\u0433 \u043a\u0443\u0440\u0441\u043e\u0432 \u0438 \u043f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u0439<\/summary>\n<div class=\"spoiler__content\">\n<p><strong>Data Science \u0438 Machine Learning<\/strong><\/p>\n<ul>\n<li>\n<p><a href=\"https:\/\/skillfactory.ru\/data-scientist-pro?utm_source=habr&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=data-science_dspr_260422&amp;utm_term=cat\">\u041f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u044f Data Scientist<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/skillfactory.ru\/data-analyst-pro?utm_source=habr&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=analytics_dapr_260422&amp;utm_term=cat\">\u041f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u044f Data Analyst<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/skillfactory.ru\/matematika-dlya-data-science#syllabus?utm_source=habr&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=data-science_mat_260422&amp;utm_term=cat\">\u041a\u0443\u0440\u0441 \u00ab\u041c\u0430\u0442\u0435\u043c\u0430\u0442\u0438\u043a\u0430 \u0434\u043b\u044f Data Science\u00bb<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/skillfactory.ru\/matematika-i-machine-learning-dlya-data-science?utm_source=habr&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=data-science_matml_260422&amp;utm_term=cat\">\u041a\u0443\u0440\u0441 \u00ab\u041c\u0430\u0442\u0435\u043c\u0430\u0442\u0438\u043a\u0430 \u0438 Machine Learning \u0434\u043b\u044f Data Science\u00bb<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/skillfactory.ru\/data-engineer?utm_source=habr&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=data-science_dea_260422&amp;utm_term=cat\">\u041a\u0443\u0440\u0441 \u043f\u043e Data Engineering<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/skillfactory.ru\/machine-learning-i-deep-learning?utm_source=habr&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=data-science_mldl_260422&amp;utm_term=cat\">\u041a\u0443\u0440\u0441 \u00abMachine Learning \u0438 Deep Learning\u00bb<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/skillfactory.ru\/machine-learning?utm_source=habr&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=data-science_ml_260422&amp;utm_term=cat\">\u041a\u0443\u0440\u0441 \u043f\u043e Machine Learning<\/a><\/p>\n<\/li>\n<\/ul>\n<p><strong>Python, \u0432\u0435\u0431-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0430<\/strong><\/p>\n<ul>\n<li>\n<p><a href=\"https:\/\/skillfactory.ru\/python-fullstack-web-developer?utm_source=habr&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=coding_fpw_260422&amp;utm_term=cat\">\u041f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u044f Fullstack-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u043d\u0430 Python<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/skillfactory.ru\/python-for-web-developers?utm_source=habr&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=coding_pws_260422&amp;utm_term=cat\">\u041a\u0443\u0440\u0441 \u00abPython \u0434\u043b\u044f \u0432\u0435\u0431-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438\u00bb<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/skillfactory.ru\/frontend-razrabotchik?utm_source=habr&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=coding_fr_260422&amp;utm_term=cat\">\u041f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u044f Frontend-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/skillfactory.ru\/webdev?utm_source=habr&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=coding_webdev_260422&amp;utm_term=cat\">\u041f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u044f \u0412\u0435\u0431-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a<\/a><\/p>\n<\/li>\n<\/ul>\n<p><strong>\u041c\u043e\u0431\u0438\u043b\u044c\u043d\u0430\u044f \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0430<\/strong><\/p>\n<ul>\n<li>\n<p><a href=\"https:\/\/skillfactory.ru\/ios-razrabotchik-s-nulya?utm_source=habr&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=coding_ios_260422&amp;utm_term=cat\">\u041f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u044f iOS-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/skillfactory.ru\/android-razrabotchik?utm_source=habr&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=coding_andr_260422&amp;utm_term=cat\">\u041f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u044f Android-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a<\/a><\/p>\n<\/li>\n<\/ul>\n<p><strong>Java \u0438 C#<\/strong><\/p>\n<ul>\n<li>\n<p><a href=\"https:\/\/skillfactory.ru\/java-razrabotchik?utm_source=habr&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=coding_java_260422&amp;utm_term=cat\">\u041f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u044f Java-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/skillfactory.ru\/java-qa-engineer-testirovshik-po?utm_source=habr&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=coding_qaja_260422&amp;utm_term=cat\">\u041f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u044f QA-\u0438\u043d\u0436\u0435\u043d\u0435\u0440 \u043d\u0430 JAVA<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/skillfactory.ru\/c-sharp-razrabotchik?utm_source=habr&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=coding_cdev_260422&amp;utm_term=cat\">\u041f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u044f C#-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/skillfactory.ru\/game-razrabotchik-na-unity-i-c-sharp?utm_source=habr&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=coding_gamedev_260422&amp;utm_term=cat\">\u041f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u044f \u0420\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u0438\u0433\u0440 \u043d\u0430 Unity<\/a><\/p>\n<\/li>\n<\/ul>\n<p><strong>\u041e\u0442 \u043e\u0441\u043d\u043e\u0432 \u2014 \u0432 \u0433\u043b\u0443\u0431\u0438\u043d\u0443<\/strong><\/p>\n<ul>\n<li>\n<p><a href=\"https:\/\/skillfactory.ru\/algoritmy-i-struktury-dannyh?utm_source=habr&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=coding_algo_260422&amp;utm_term=cat\">\u041a\u0443\u0440\u0441 \u00ab\u0410\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u044b \u0438 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u0434\u0430\u043d\u043d\u044b\u0445\u00bb<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/skillfactory.ru\/c-plus-plus-razrabotchik?utm_source=habr&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=coding_cplus_260422&amp;utm_term=cat\">\u041f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u044f C++ \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/skillfactory.ru\/cyber-security-etichnij-haker?utm_source=habr&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=coding_hacker_260422&amp;utm_term=cat\">\u041f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u044f \u042d\u0442\u0438\u0447\u043d\u044b\u0439 \u0445\u0430\u043a\u0435\u0440<\/a><\/p>\n<\/li>\n<\/ul>\n<p><strong>\u0410 \u0442\u0430\u043a\u0436\u0435<\/strong><\/p>\n<ul>\n<li>\n<p><a href=\"https:\/\/skillfactory.ru\/devops-ingineer?utm_source=habr&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=coding_devops_260422&amp;utm_term=cat\">\u041a\u0443\u0440\u0441 \u043f\u043e DevOps<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/skillfactory.ru\/catalogue?utm_source=habr&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=sf_allcourses_260422&amp;utm_term=cat\">\u0412\u0441\u0435 \u043a\u0443\u0440\u0441\u044b<\/a><\/p>\n<\/li>\n<\/ul>\n<\/div>\n<\/details>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"v-portal\" style=\"display:none;\"><\/div>\n<\/div>\n<p> <!----> <!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/company\/skillfactory\/blog\/662932\/\"> https:\/\/habr.com\/ru\/company\/skillfactory\/blog\/662932\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u0421\u043c\u044f\u0433\u0447\u0435\u043d\u0438\u0435 \u0443\u044f\u0437\u0432\u0438\u043c\u043e\u0441\u0442\u0438 Trojan Source, \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u0442\u0438\u043f\u043e\u0432, \u043c\u043d\u043e\u0433\u043e\u043c\u0435\u0440\u043d\u044b\u0439 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440 [], \u043f\u043e\u0434\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0439 \u043e \u0432\u0435\u043d\u0434\u043e\u0440\u043d\u044b\u0445 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0430\u0445 \u2014 \u0432\u043e\u0442 \u043b\u0438\u0448\u044c \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 GCC 12. \u041f\u043e\u0434\u0440\u043e\u0431\u043d\u043e\u0441\u0442\u044f\u043c\u0438 \u0434\u0435\u043b\u0438\u043c\u0441\u044f \u043a \u0441\u0442\u0430\u0440\u0442\u0443 <a href=\"https:\/\/skillfactory.ru\/c-plus-plus-razrabotchik?utm_source=habr&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=coding_cplus_260422&amp;utm_term=lead\">\u043a\u0443\u0440\u0441\u0430 \u043f\u043e \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u043d\u0430 C++<\/a>.<\/p>\n<hr\/>\n<p>\u0420\u0435\u043b\u0438\u0437 GNU GCC 12.1 (\u043f\u043e\u043b\u043d\u044b\u0439 \u0441\u043f\u0438\u0441\u043e\u043a \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439 <a href=\"https:\/\/gcc.gnu.org\/gcc-12\/changes.html\">\u0437\u0434\u0435\u0441\u044c<\/a>) \u0441\u043e\u0441\u0442\u043e\u0438\u0442\u0441\u044f \u0432 \u0430\u043f\u0440\u0435\u043b\u0435 2022 \u0433\u043e\u0434\u0430. \u0423\u0436\u0435 \u0441\u0435\u0439\u0447\u0430\u0441 GCC 12 \u2014 \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u0439 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u0432 Fedora 36, \u0438 \u043e\u043d \u0431\u0443\u0434\u0435\u0442 \u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d \u0432 Red Hat Enterprise Linux \u0432 Red Hat Developer Toolset 7 \u0438\u043b\u0438 Red Hat GCC Toolset 8 \u0438 9. \u042f \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443 \u0442\u043e\u043b\u044c\u043a\u043e \u043e \u043d\u043e\u0432\u044b\u0445 \u0444\u0438\u0447\u0430\u0445, \u0432\u043b\u0438\u044f\u044e\u0449\u0438\u0445 \u043d\u0430 C++.<\/p>\n<p>\u0414\u0438\u0430\u043b\u0435\u043a\u0442 GCC 12 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u2014 -std=gnu++17. C++23 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u043c -std=c++23; \u0444\u043b\u0430\u0433 -std=gnu++23 \u0432\u043a\u043b\u044e\u0447\u0430\u0435\u0442 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f GNU. C++20 \u0438 C++23 \u0432 GCC 12 \u043f\u043e-\u043f\u0440\u0435\u0436\u043d\u0435\u043c\u0443 \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u0430\u043b\u044c\u043d\u044b\u0435, \u0430 \u0432 \u0430\u043f\u0440\u0435\u043b\u044c\u0441\u043a\u043e\u043c GCC \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043e \u0435\u0449\u0451 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u0438\u0439 \u0438\u0437 \u0421++23.<\/p>\n<h3>if consteval<\/h3>\n<p>\u0412 C++17 \u043f\u043e\u044f\u0432\u0438\u043b\u0441\u044f \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440 constexpr if, \u0443\u0441\u043b\u043e\u0432\u0438\u0435 \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0434\u043e\u043b\u0436\u043d\u043e \u0431\u044b\u0442\u044c \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435\u043c-\u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u043e\u0439, (\u043e\u043d\u043e \u044f\u0432\u043d\u043e \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0435\u0442\u0441\u044f \u043a\u0430\u043a \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u0430). <\/p>\n<ul>\n<li>\n<p>\u0415\u0441\u043b\u0438 \u0443\u0441\u043b\u043e\u0432\u0438\u0435 \u0438\u0441\u0442\u0438\u043d\u043d\u043e, \u0432\u0435\u0442\u0432\u044c else \u043e\u0442\u0431\u0440\u0430\u0441\u044b\u0432\u0430\u0435\u0442\u0441\u044f, \u0442\u043e \u0435\u0441\u0442\u044c \u043d\u0435 \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438. <\/p>\n<\/li>\n<li>\n<p>\u0415\u0441\u043b\u0438 \u0443\u0441\u043b\u043e\u0432\u0438\u0435 \u043b\u043e\u0436\u043d\u043e, \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0430\u044f \u0432\u0435\u0442\u0432\u044c \u0442\u0430\u043a\u0436\u0435 \u043e\u0442\u0431\u0440\u0430\u0441\u044b\u0432\u0430\u0435\u0442\u0441\u044f.<\/p>\n<\/li>\n<li>\n<p>\u0415\u0441\u043b\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u0430 \u043a\u0430\u043a constexpr, \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438 \u043e\u043d\u0430 \u043c\u043e\u0436\u0435\u0442 \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0442\u044c\u0441\u044f \u0438\u043b\u0438 \u043d\u0435 \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0442\u044c\u0441\u044f \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0430. <\/p>\n<\/li>\n<\/ul>\n<p>\u0427\u0442\u043e\u0431\u044b \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u0438\u043c\u0435\u043b \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043e \u0442\u043e\u043c, \u043a\u043e\u0433\u0434\u0430 \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0435\u0442\u0441\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f, \u0432 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u0443\u044e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 C++20 \u0432\u0432\u0435\u0434\u0435\u043d\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044f std::is_constant_evaluated. \u041e\u043d\u0430 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 true, \u043a\u043e\u0433\u0434\u0430 \u0442\u0435\u043a\u0443\u0449\u0438\u0439 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442 \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0435\u0442\u0441\u044f \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438:<\/p>\n<pre><code class=\"cpp\">#include &lt;type_traits>  int slow (int);  constexpr int fn (int n) {   if (std::is_constant_evaluated ())     return n &lt;&lt; 1; \/\/ #1   else     return slow (n); \/\/ #2 }  constexpr int i = fn (10); \/\/ does #1 int n = 10; int i2 = fn (n); \/\/ calls slow function #2<\/code><\/pre>\n<p>\u0412 C++20 \u043f\u043e\u044f\u0432\u0438\u043b\u043e\u0441\u044c \u043a\u043b\u044e\u0447\u0435\u0432\u043e\u0435 \u0441\u043b\u043e\u0432\u043e consteval. \u0424\u0443\u043d\u043a\u0446\u0438\u044f, \u0444\u0443\u043d\u043a\u0446\u0438\u044f-\u0447\u043b\u0435\u043d \u0438\u043b\u0438 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440 \u0441 consteval \u2014 \u044d\u0442\u043e \u043d\u0435\u043c\u0435\u0434\u043b\u0435\u043d\u043d\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f (immediate function), \u0434\u043b\u044f \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u043d\u0435 \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u0442 \u043a\u043e\u0434. <\/p>\n<p>\u041d\u0435\u043c\u0435\u0434\u043b\u0435\u043d\u043d\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u044e\u0442\u0441\u044f \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438 \u0438 \u0434\u043e\u043b\u0436\u043d\u044b \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u0443, \u043a\u0440\u043e\u043c\u0435 \u0441\u043b\u0443\u0447\u0430\u0435\u0432, \u043a\u043e\u0433\u0434\u0430 \u0442\u0430\u043a\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0438\u0437 \u0434\u0440\u0443\u0433\u043e\u0439 \u043d\u0435\u043c\u0435\u0434\u043b\u0435\u043d\u043d\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u0430 \u0435\u0441\u043b\u0438 \u044d\u0442\u043e \u043d\u0435 \u0442\u0430\u043a, \u0442\u043e \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u0435\u0442 \u043e\u0448\u0438\u0431\u043a\u0430 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438.<\/p>\n<p>\u041a\u0430\u043a \u0431\u044b \u0442\u043e \u043d\u0438 \u0431\u044b\u043b\u043e, \u0432 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u043c \u0442\u0435\u0441\u0442\u0435 \u043f\u0440\u0430\u0432\u0438\u043b\u0430 \u044f\u0437\u044b\u043a\u0430 \u0437\u0430\u043f\u0440\u0435\u0449\u0430\u044e\u0442 \u0437\u0430\u043c\u0435\u043d\u0438\u0442\u044c n &lt;&lt; 1 \u0432\u044b\u0437\u043e\u0432\u043e\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u0438 consteval:<\/p>\n<pre><code class=\"cpp\">#include &lt;type_traits>  int slow (int); consteval int fast (int n) { return n &lt;&lt; 1; }  constexpr int fn (int n) {   if (std::is_constant_evaluated ())     return fast (n); \/\/ 'n' is not a constant expression   else     return slow (n); } constexpr int i = fn (10);<\/code><\/pre>\n<p>\u042d\u0442\u043e\u0442 \u043d\u0435\u0434\u043e\u0447\u0451\u0442 <a href=\"https:\/\/wg21.link\/p1938\">\u0438\u0441\u043f\u0440\u0430\u0432\u043b\u0435\u043d<\/a> \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u0438\u0435\u043c \u043e \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0438 if consteval, \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u043e\u043c \u0432 GCC 12. \u0421 \u043f\u043e\u043c\u043e\u0449\u044c\u044e if consteval \u0432\u044b\u0437\u044b\u0432\u0430\u0442\u044c \u043d\u0435\u043c\u0435\u0434\u043b\u0435\u043d\u043d\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043c\u043e\u0436\u043d\u043e \u0442\u0430\u043a:<\/p>\n<pre><code class=\"cpp\">#include &lt;type_traits>  int slow (int); consteval int fast (int n) { return n &lt;&lt; 1; }  constexpr int fn (int n) {   if consteval {     return fast (n); \/\/ OK   } else {     return slow (n);   } }  constexpr int i = fn (10);<\/code><\/pre>\n<blockquote>\n<p>if consteval \u0434\u043e\u043f\u0443\u0441\u0442\u0438\u043c\u043e \u0432 \u043e\u0431\u044b\u0447\u043d\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u0433\u0434\u0435 \u043d\u0435\u0442 constexpr. \u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, \u0432 \u043e\u0442\u043b\u0438\u0447\u0438\u0435 \u043e\u0442 \u043e\u0431\u044b\u0447\u043d\u043e\u0433\u043e if, \u0432 if consteval \u0444\u0438\u0433\u0443\u0440\u043d\u044b\u0435 \u0441\u043a\u043e\u0431\u043a\u0438 \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u044b.<\/p>\n<\/blockquote>\n<p>\u041f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f if constexpr \u0438 std::is_constant_evaluated, \u043a \u0441\u0447\u0430\u0441\u0442\u044c\u044e, \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u043e\u043c, \u0441\u043c\u043e\u0442\u0440\u0438\u0442\u0435 \u0440\u0430\u0437\u0434\u0435\u043b std::is_constant_evaluated \u0432 \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u044f\u0445 \u0434\u043b\u044f if.<\/p>\n<h4>auto(x)<\/h4>\n<p>GCC 12 <a href=\"https:\/\/wg21.link\/p0849\">\u0434\u043e\u043f\u0443\u0441\u043a\u0430\u0435\u0442<\/a> \u043a\u043b\u044e\u0447\u0435\u0432\u043e\u0435 \u0441\u043b\u043e\u0432\u043e auto \u0432 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u0438\u0438 \u0442\u0438\u043f\u043e\u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0441\u0442\u0438\u043b\u044f: auto <a href=\"https:\/\/en.cppreference.com\/w\/cpp\/language\/value_category\">\u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442\u0441\u044f<\/a> \u043a \u0447\u0438\u0441\u0442\u043e\u043c\u0443 rvalue.<\/p>\n<pre><code class=\"cpp\">struct A {}; void f(A&amp;);  \/\/ #1 void f(A&amp;&amp;); \/\/ #2 A&amp; g();  void h() {   f(g()); \/\/ calls #1   f(auto(g())); \/\/ calls #2 with a temporary object }<\/code><\/pre>\n<blockquote>\n<p>\u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435: \u0434\u043e\u043f\u0443\u0441\u0442\u0438\u043c\u044b auto(x) \u0438 auto{x}, \u043d\u043e \u043d\u0435 decltype(auto)(x).<\/p>\n<\/blockquote>\n<h4>\u041d\u0435\u043b\u0438\u0442\u0435\u0440\u0430\u043b\u044c\u043d\u044b\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u044f\u0445 constexpr<\/h4>\n<p>\u041a\u043e\u0433\u0434\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 constexpr \u043d\u0435 \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u044e\u0442\u0441\u044f \u043a\u0430\u043a \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u044b, GCC 12 <a href=\"https:\/\/wg21.link\/p2242\">\u0434\u043e\u043f\u0443\u0441\u043a\u0430\u0435\u0442<\/a> \u043d\u0435\u043b\u0438\u0442\u0435\u0440\u0430\u043b\u044c\u043d\u044b\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435, \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u044b goto \u0438 \u043c\u0435\u0442\u043a\u0438 \u0432 \u043d\u0438\u0445, \u0447\u0442\u043e \u043f\u043e\u043b\u0435\u0437\u043d\u043e \u0434\u043b\u044f \u043a\u043e\u0434\u0430, \u043f\u043e\u0434\u043e\u0431\u043d\u043e\u0433\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c\u0443 (\u0432\u0437\u044f\u0442 \u0438\u0437 \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u0438\u044f):<\/p>\n<pre><code class=\"cpp\">#include &lt;type_traits>  template&lt;typename T> constexpr bool f() {   if (std::is_constant_evaluated()) {     return true;   } else {     T t; \/\/ OK when T=nonliteral in C++23     return true;   } } struct nonliteral { nonliteral(); }; static_assert(f&lt;nonliteral>());<\/code><\/pre>\n<p>\u0422\u0430\u043a\u043e\u0439 \u043a\u043e\u0434 \u043d\u0435 \u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0432 C++20, \u043d\u043e \u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0432 C++23, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0432\u0435\u0442\u0432\u044c else \u043d\u0435 \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0435\u0442\u0441\u044f. \u0422\u0430\u043a\u0436\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0432 C++23 \u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u043f\u0440\u0438\u043c\u0435\u0440:<\/p>\n<pre><code class=\"cpp\">constexpr int foo (int i) {   if (i == 0)     return 42;   static int a;   thread_local int t;   goto label; label:   return 0; }<\/code><\/pre>\n<h4>\u041c\u043d\u043e\u0433\u043e\u043c\u0435\u0440\u043d\u044b\u0439 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440 []<\/h4>\n<p>\u0412 C++ \u0444\u0443\u043d\u043a\u0446\u0438\u044f-\u0447\u043b\u0435\u043d operator[] \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u043c \u043c\u0430\u0441\u0441\u0438\u0432\u0430 \u0438 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u043c \u0442\u0438\u043f\u043e\u0432, \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0445 \u043c\u0430\u0441\u0441\u0438\u0432\u0430\u043c, \u0442\u0430\u043a\u0438\u043c \u043a\u0430\u043a std::array, std::span, std::vector \u0438 std::string. GCC 12 <a href=\"https:\/\/wg21.link\/p2128\">\u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442<\/a> \u043c\u043d\u043e\u0433\u043e\u043c\u0435\u0440\u043d\u044b\u0439 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440 \u0438\u043d\u0434\u0435\u043a\u0441\u0430. \u0412\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0441 \u0437\u0430\u043f\u044f\u0442\u044b\u043c\u0438 \u0432 [] <a href=\"https:\/\/wg21.link\/p1161\">\u0443\u0441\u0442\u0430\u0440\u0435\u043b\u0438<\/a> \u0432 C++20, \u0430 \u0432 C++23 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0437\u0430\u043f\u044f\u0442\u043e\u0439 \u0432 [] \u0438\u0437\u043c\u0435\u043d\u0438\u043b\u043e\u0441\u044c.<\/p>\n<p>\u0412 C++20 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440 [] \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u043b \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u0438\u043d \u044d\u043b\u0435\u043c\u0435\u043d\u0442, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u043c \u043c\u043d\u043e\u0433\u043e\u043c\u0435\u0440\u043d\u044b\u0445 \u043c\u0430\u0441\u0441\u0438\u0432\u043e\u0432 \u043f\u043e\u043b\u0443\u0447\u0430\u043b\u0438 \u0447\u0435\u0440\u0435\u0437 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u044b \u0432\u044b\u0437\u043e\u0432\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u0439: arr(x, y, z), \u0438 \u043f\u043e\u0445\u043e\u0436\u0438\u0445 \u043e\u0431\u0445\u043e\u0434\u043d\u044b\u0445 \u043f\u0443\u0442\u0435\u0439, \u043d\u0435 \u043b\u0438\u0448\u0451\u043d\u043d\u044b\u0445 \u043d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043a\u043e\u0432. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 C++23 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u0443 [] \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0442\u044c \u043d\u043e\u043b\u044c \u0438\u043b\u0438 \u0431\u043e\u043b\u0435\u0435 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432, \u0430 \u0437\u043d\u0430\u0447\u0438\u0442,  \u043f\u0440\u0438 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438 \u0441 \u0444\u043b\u0430\u0433\u043e\u043c -std=c++23 \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u044d\u0442\u043e\u0442 \u043f\u0440\u0438\u043c\u0435\u0440:<\/p>\n<pre><code class=\"cpp\">template &lt;typename... T> struct W {   constexpr auto operator[](T&amp;&amp;...); };  W&lt;> w1; W&lt;int> w2; W&lt;int, int> w3;<\/code><\/pre>\n<p>\u041f\u043e\u043d\u044f\u0442\u043d\u0435\u0435 \u0431\u0443\u0434\u0435\u0442 \u044d\u0442\u043e\u0442 \u043a\u043e\u0434 \u0441 \u043a\u0440\u0430\u0439\u043d\u0435 \u043d\u0430\u0438\u0432\u043d\u043e\u0439 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0435\u0439:<\/p>\n<pre><code class=\"cpp\">struct S {   int a[64];   constexpr S () : a {} {};   constexpr S (int x, int y, int z) : a {x, y, z} {};   constexpr int &amp;operator[] () { return a[0]; }   constexpr int &amp;operator[] (int x) { return a[x]; }   constexpr int &amp;operator[] (int x, long y) { return a[x + y * 8]; } };  void g () {   S s;   s[] = 42;   s[5] = 36;   s[3, 4] = 72; }<\/code><\/pre>\n<p>\u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f GNU, \u0435\u0441\u043b\u0438 GCC \u043d\u0435 \u043d\u0430\u0445\u043e\u0434\u0438\u0442 \u043f\u0435\u0440\u0435\u0433\u0440\u0443\u0437\u043a\u0443 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u0430 [], \u0442\u043e \u0432\u0435\u0434\u0451\u0442 \u0441\u0435\u0431\u044f \u043a\u0430\u043a \u0440\u0430\u043d\u044c\u0448\u0435, \u043d\u043e \u0432\u044b\u0434\u0430\u0451\u0442 \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435:<\/p>\n<pre><code class=\"cpp\">void f(int a[], int b, int c) {   a[b,c]; \/\/ deprecated in C++20, invalid but accepted with a warning in C++23   a[(b,c)]; \/\/ OK in both C++20 and C++23  }<\/code><\/pre>\n<p>\u0423\u0447\u0442\u0438\u0442\u0435, \u0447\u0442\u043e operator[] \u043d\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u044b \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e, \u043d\u043e \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u0438\u0445 <a href=\"https:\/\/wg21.link\/cwg2507\">\u0440\u0430\u0437\u0440\u0435\u0448\u0430\u0442<\/a> \u043f\u043e\u0437\u0436\u0435. \u0415\u0441\u043b\u0438 \u0438 \u043a\u043e\u0433\u0434\u0430 \u044d\u0442\u043e \u0441\u043b\u0443\u0447\u0438\u0442\u0441\u044f, \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u043a\u043e\u0434 \u043d\u0438\u0436\u0435:<\/p>\n<pre><code class=\"cpp\">struct X {   int a[64];   constexpr int&amp; operator[](int i = 1) { return a[i]; } }; <\/code><\/pre>\n<h4>elifdef \u0438 elifndef<\/h4>\n<p>\u0412 C \u0438 C++ \u0434\u0438\u0440\u0435\u043a\u0442\u0438\u0432\u044b #ifdef \u0438 #ifndef \u2014 \u044d\u0442\u043e \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0441\u0430\u0445\u0430\u0440 \u0434\u043b\u044f #ifdefined(&#8230;) \u0438 #if !defined(&#8230;). \u0423\u0434\u0438\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e, \u043d\u043e \u0443 \u0434\u0440\u0443\u0433\u0438\u0445 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u043e\u0432 \u044d\u0442\u0438\u0445 \u0434\u0438\u0440\u0435\u043a\u0442\u0438\u0432 \u0442\u0430\u043a\u0438\u0445 \u0441\u043e\u043a\u0440\u0430\u0449\u0435\u043d\u0438\u0439 \u043d\u0435\u0442. \u0427\u0442\u043e\u0431\u044b \u0438\u0441\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u044d\u0442\u043e, \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 C \u0438 C++ \u043f\u0440\u0438\u043d\u044f\u043b\u0438 \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u0438\u044f <a href=\"http:\/\/www.open-std.org\/jtc1\/sc22\/wg14\/www\/docs\/n2645.pdf\">N2645<\/a> \u0438 <a href=\"https:\/\/wg21.link\/p2334\">P2334R1<\/a>. \u0412 GCC 12 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u044b \u043e\u0431\u0430 \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u043f\u0440\u0438\u043c\u0435\u0440 \u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u0443\u0435\u0442\u0441\u044f:<\/p>\n<pre><code class=\"cpp\">#ifdef __STDC__ \/* ... *\/ #elifndef __cplusplus #warning \"not ISO C\" #else \/* ... *\/ #endif<\/code><\/pre>\n<blockquote>\n<p>\u0414\u043b\u044f \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438 \u044d\u0442\u043e\u0433\u043e \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u0432 C++20 \u0438 \u0431\u043e\u043b\u0435\u0435 \u0440\u0430\u043d\u043d\u0438\u0445 \u0432\u0435\u0440\u0441\u0438\u044f\u0445 \u043d\u0443\u0436\u043d\u043e \u0432\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f GNU. \u0414\u0440\u0443\u0433\u0438\u043c\u0438 \u0441\u043b\u043e\u0432\u0430\u043c\u0438, \u0444\u043b\u0430\u0433 -std=c++20 \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442 \u043a \u043e\u0448\u0438\u0431\u043a\u0435 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438, \u0430 \u0441 \u0444\u043b\u0430\u0433\u0430\u043c\u0438 -std=gnu++20 \u0438 -Wpedantic \u2014 \u043a \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u044e \u0442\u0438\u043f\u0430 pedantic, \u0442\u043e \u0435\u0441\u0442\u044c \u043e \u043d\u0435\u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0438 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u0443 ISO.<\/p>\n<\/blockquote>\n<h4>\u041f\u0441\u0435\u0432\u0434\u043e\u043d\u0438\u043c\u044b \u0432 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u0435 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438<\/h4>\n<p>GCC 12 <a href=\"https:\/\/wg21.link\/p2360r0\">\u0440\u0430\u0437\u0440\u0435\u0448\u0430\u0435\u0442<\/a> \u043e\u0431\u044a\u044f\u0432\u043b\u044f\u0442\u044c \u043f\u0441\u0435\u0432\u0434\u043e\u043d\u0438\u043c\u044b \u0432 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u0435 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u043e\u043c \u0432\u043d\u0443\u0442\u0440\u0438 if, for \u0438 switch:<\/p>\n<pre><code class=\"cpp\">for (using T = int; T e : v)   {     \/\/ use e   }<\/code><\/pre>\n<h3>\u0418\u0441\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0438 \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0438\u0435 \u0443\u043b\u0443\u0447\u0448\u0435\u043d\u0438\u044f<\/h3>\n<p>\u0418\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0432 \u044d\u0442\u043e\u043c \u0440\u0430\u0437\u0434\u0435\u043b\u0435 \u0441\u043e\u0433\u043b\u0430\u0441\u0443\u044e\u0442 GCC \u0441 \u043d\u043e\u0432\u043e\u0432\u0432\u0435\u0434\u0435\u043d\u0438\u044f\u043c\u0438 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u0430 \u0438 \u0440\u0430\u0437\u0440\u0435\u0448\u0430\u044e\u0442 \u0440\u0430\u043d\u0435\u0435 \u043d\u0435\u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e\u0435 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435.<\/p>\n<h4>\u0418\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u043f\u043e\u0438\u0441\u043a\u0430 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0433\u043e \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u0430<\/h4>\n<p>\u0414\u043e GCC 12 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u043b \u043d\u0435\u043a\u0432\u0430\u043b\u0438\u0444\u0438\u0446\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043f\u043e\u0438\u0441\u043a \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0433\u043e \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u043d\u043e\u0433\u043e \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0448\u0430\u0431\u043b\u043e\u043d\u0430, \u0430 \u043d\u0435 \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u0438\u043d\u0441\u0442\u0430\u043d\u0446\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f. \u041f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435 GCC 12 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u043c\u0443 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u044e \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u044b\u0445 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0439 \u0432\u044b\u0437\u043e\u0432\u0430:<\/p>\n<pre><code class=\"cpp\">#include &lt;iostream>  namespace N {   struct A { }; }  void operator+(N::A, double) {   std::cout &lt;&lt; \"#1 \"; }  template&lt;class T> void f(T t) {   operator+(t, 0);   t + 0; }  \/\/ Since it's not visible from the template definition, this later-declared \/\/ operator overload should not be considered when instantiating f&lt;N::A>(N::A), \/\/ for either the call or operator expression. void operator+(N::A, int) {   std::cout &lt;&lt; \"#2 \"; }  int main() {   N::A a;   f(a);   std::cout &lt;&lt; std::endl; }<\/code><\/pre>\n<p>\u0412 GCC 11 \u0438 \u0441\u0442\u0430\u0440\u044b\u0445 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u0430\u0445 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430 \u0432\u044b\u0432\u0435\u0434\u0435\u0442 #1 #2, \u043d\u043e \u0432 GCC 12 \u2014 #1 #1: \u0440\u0430\u043d\u0435\u0435 \u0432 \u043f\u0435\u0440\u0435\u0433\u0440\u0443\u0437\u043a\u0443 \u0440\u0430\u0437\u0440\u0435\u0448\u0430\u043b\u043e\u0441\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0432\u044b\u0437\u043e\u0432\u0430 #1, \u0430 \u0432 GCC 12 \u0432 \u043f\u0435\u0440\u0435\u0433\u0440\u0443\u0437\u043a\u0443 \u0440\u0430\u0437\u0440\u0435\u0448\u0430\u0435\u0442\u0441\u044f \u0438 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u043d\u043e\u0435 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435.<\/p>\n<h4>\u0421\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440 auto \u0434\u043b\u044f \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u0435\u0439 \u0438 \u0441\u0441\u044b\u043b\u043e\u043a \u043d\u0430 \u043c\u0430\u0441\u0441\u0438\u0432\u044b<\/h4>\n<p>GCC 12 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0438\u0437 <a href=\"https:\/\/wg21.link\/cwg2397\">\u043e\u0442\u0447\u0451\u0442\u0430<\/a> \u043e \u0434\u0435\u0444\u0435\u043a\u0442\u0430\u0445 DR2397: \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440 auto \u0434\u043b\u044f \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u0435\u0439 \u0438 \u0441\u0441\u044b\u043b\u043e\u043a \u043d\u0430 \u043c\u0430\u0441\u0441\u0438\u0432\u044b, \u0438 \u0442\u0435\u043f\u0435\u0440\u044c \u0442\u0438\u043f \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 \u043c\u0430\u0441\u0441\u0438\u0432\u0430 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0442\u0438\u043f\u043e\u043c \u0441\u043e \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u043e\u043c auto, \u0442\u043e \u0435\u0441\u0442\u044c \u043a\u043e\u0434 \u043d\u0438\u0436\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442:<\/p>\n<pre><code class=\"cpp\">int a[3]; auto (*p)[3] = &amp;a; auto (&amp;r)[3] = a;<\/code><\/pre>\n<p>\u041d\u043e \u043c\u0430\u0441\u0441\u0438\u0432 \u0440\u0430\u0441\u043f\u0430\u0434\u0430\u0435\u0442\u0441\u044f \u043d\u0430 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u0432\u044b\u0432\u043e\u0434 \u0442\u0438\u043f\u0430 auto \u0437\u0434\u0435\u0441\u044c \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u0441 \u0442\u043e\u0447\u043a\u0438 \u0437\u0440\u0435\u043d\u0438\u044f \u0432\u044b\u0432\u043e\u0434\u0430 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0430 \u0448\u0430\u0431\u043b\u043e\u043d\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043d\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043d\u0438 \u043e\u0434\u0438\u043d \u0438\u0437 \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u043e\u0432 \u043d\u0438\u0436\u0435:<\/p>\n<pre><code class=\"cpp\">auto (&amp;&amp;r)[2] = { 1, 2 }; auto arr[2] = { 1, 2 };  int arr[5]; auto x[5] = arr;<\/code><\/pre>\n<p>\u0425\u043e\u0442\u044f \u043a\u043e\u0433\u0434\u0430-\u043d\u0438\u0431\u0443\u0434\u044c \u043e\u043d \u043c\u043e\u0436\u0435\u0442 \u0437\u0430\u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c.<\/p>\n<h4>\u0421\u0432\u0451\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u0435 \u0442\u0440\u0438\u0432\u0438\u0430\u043b\u044c\u043d\u044b\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439<\/h4>\n<p>std::move \u0438\u043b\u0438 std::forward \u2014 \u044d\u0442\u043e \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u0442\u0438\u043f\u043e\u0432, \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u043a\u0430\u043a \u0432\u044b\u0437\u043e\u0432\u044b \u0444\u0443\u043d\u043a\u0446\u0438\u0439, \u0442\u043e \u0435\u0441\u0442\u044c \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u0442 \u043e\u0442\u043b\u0430\u0434\u043e\u0447\u043d\u0443\u044e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e, \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u043c\u0443\u044e \u0434\u0430\u0436\u0435 \u043f\u043e\u0441\u043b\u0435 \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u043e\u0433\u043e \u0432\u044b\u0437\u043e\u0432\u0430, \u0445\u043e\u0442\u044f \u043e\u0442\u043b\u0430\u0436\u0438\u0432\u0430\u0442\u044c \u0442\u0430\u043a\u043e\u0439 \u043a\u043e\u0434 \u043d\u0435 \u043d\u0443\u0436\u043d\u043e. <\/p>\n<p>GCC 12 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u0443\u0435\u0442 \u0432\u044b\u0437\u043e\u0432\u044b \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0442\u0440\u0438\u0432\u0438\u0430\u043b\u044c\u043d\u044b\u0445 \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 std::move, std::forward, std::addressof \u0438 std::as_const) \u0432 \u043f\u0440\u043e\u0441\u0442\u044b\u0435 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u0442\u0438\u043f\u043e\u0432. \u042d\u0442\u043e \u0447\u0430\u0441\u0442\u044c \u043e\u0431\u0449\u0435\u0439 \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u044b \u0441\u0432\u0451\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u044f \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0439 \u043f\u0440\u0438 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u043e\u043c. <\/p>\n<p>\u0422\u0430\u043a \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043e\u0442\u043b\u0430\u0434\u043e\u0447\u043d\u043e\u0439 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 GCC \u043c\u043e\u0436\u0435\u0442 \u0441\u043e\u043a\u0440\u0430\u0442\u0438\u0442\u044c\u0441\u044f \u043d\u0430 10%, \u0442\u0430\u043a\u0436\u0435 \u0441\u043e\u043a\u0440\u0430\u0449\u0430\u044e\u0442\u0441\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u0430\u044f \u043f\u0430\u043c\u044f\u0442\u044c \u0438 \u0432\u0440\u0435\u043c\u044f \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438. \u041e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u044f \u0432\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0444\u043b\u0430\u0433\u043e\u043c -ffold-simple-inlines.<\/p>\n<h4>\u041e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f \u0432 \u0438\u0437\u043b\u0438\u0448\u043d\u0435 \u0441\u0432\u043e\u0431\u043e\u0434\u043d\u043e\u0439 \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 enum direct-list-initialization<\/h4>\n<p>GCC 12 \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u0442 <a href=\"https:\/\/wg21.link\/cwg2374\">\u043e\u0442\u0447\u0451\u0442 <\/a>\u043e \u0434\u0435\u0444\u0435\u043a\u0442\u0435, \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0437\u0430\u043f\u0440\u0435\u0449\u0430\u0435\u0442, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043f\u0440\u044f\u043c\u0443\u044e \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f \u0441 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u043d\u043e\u0439 \u043e\u0431\u043b\u0430\u0441\u0442\u044c\u044e \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0438\u0437 \u0434\u0440\u0443\u0433\u043e\u0433\u043e \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f \u044d\u0442\u043e\u0433\u043e \u0436\u0435 \u0442\u0438\u043f\u0430:<\/p>\n<pre><code class=\"cpp\">enum class Orange; enum class Apple; Orange o; Apple a{o}; \/\/ error with GCC 12<\/code><\/pre>\n<h4>\u041d\u0435\u0442\u0438\u043f\u043e\u0432\u044b\u0435 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u044b \u0448\u0430\u0431\u043b\u043e\u043d\u0430 \u0432 \u0447\u0430\u0441\u0442\u0438\u0447\u043d\u044b\u0445 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f\u0445<\/h4>\n<p>\u0420\u0430\u043d\u0435\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u0448\u0430\u0431\u043b\u043e\u043d\u0430 \u043a\u0430\u043a \u0435\u0433\u043e \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u0437\u0430\u043f\u0440\u0435\u0449\u0430\u043b\u043e\u0441\u044c. \u042d\u0442\u043e\u0442 \u0437\u0430\u043f\u0440\u0435\u0442 \u0441\u043d\u044f\u043b\u0438 \u0432 \u043e\u0442\u0432\u0435\u0442 \u043d\u0430 <a href=\"http:\/\/www.open-std.org\/jtc1\/sc22\/wg21\/docs\/cwg_defects.html#1315\">\u043e\u0442\u0447\u0451\u0442<\/a> \u043e \u0434\u0435\u0444\u0435\u043a\u0442\u0435. \u0421\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0435 \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430 \u0448\u0430\u0431\u043b\u043e\u043d\u0430 \u043a\u0430\u043a \u0435\u0433\u043e \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0430 \u0441\u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u0443\u0435\u0442\u0441\u044f:<\/p>\n<pre><code class=\"cpp\">template &lt;int I, int J> struct A {}; template &lt;int I> struct A&lt;I, I*2> {}; \/\/ OK with GCC 12<\/code><\/pre>\n<h4>\u041f\u043e\u0434\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u0432 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0432 \u043b\u0435\u043a\u0441\u0438\u0447\u0435\u0441\u043a\u043e\u043c \u043f\u043e\u0440\u044f\u0434\u043a\u0435<\/h4>\n<p>\u0412\u044b\u0432\u043e\u0434<\/p>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-332463","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/332463","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=332463"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/332463\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=332463"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=332463"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=332463"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}