{"id":26726,"date":"2020-10-06T17:56:43","date_gmt":"2020-10-06T17:56:43","guid":{"rendered":"https:\/\/devblogs.microsoft.com\/cppblog\/?p=26726"},"modified":"2020-10-06T17:58:52","modified_gmt":"2020-10-06T17:58:52","slug":"c-core-check-in-visual-studio","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/cppblog\/c-core-check-in-visual-studio\/","title":{"rendered":"C++ Core Check in Visual Studio"},"content":{"rendered":"<p>C++ Core Check is Microsoft\u2019s static analysis tool that enforces the rules from the <a href=\"https:\/\/isocpp.github.io\/CppCoreGuidelines\/CppCoreGuidelines\">C++ Core Guidelines<\/a>, which is maintained by the C++ Foundation. This post is to provide a snapshot of the C++ Core Guidelines coverage that C++ Core Check offers.<\/p>\n<p>For background, the C++ team introduced C++ Core Check in December 2015 as part of <a href=\"https:\/\/devblogs.microsoft.com\/cppblog\/c-core-guidelines-checkers-available-for-vs-2015-update-1\/\">Visual Studio 2015 Update 1<\/a>. At the time of its release, C++ Core Check offered rules from the <a href=\"https:\/\/github.com\/isocpp\/CppCoreGuidelines\/blob\/master\/CppCoreGuidelines.md#SS-bounds\">Bounds profile<\/a> and <a href=\"https:\/\/github.com\/isocpp\/CppCoreGuidelines\/blob\/master\/CppCoreGuidelines.md#SS-type\">Type profile<\/a> with the promise of the <a href=\"https:\/\/github.com\/isocpp\/CppCoreGuidelines\/blob\/master\/CppCoreGuidelines.md#prolifetime-lifetime-safety-profile\">Lifetimes profile<\/a> to follow.<\/p>\n<p>The C++ team has <span style=\"font-size: 1rem;\">been expanding C++ Core Check&#8217;s coverage over the last five years. We have added more rules into the existing Type, Bounds, and Lifetimes profiles and have expanded into other areas of the C++ Core Guidelines, which you can see in the tables at the bottom of the post. For a more detailed view into the growth and evolution of C++ Core Check, see the other posts in our blog <a href=\"https:\/\/devblogs.microsoft.com\/cppblog\/tag\/cppcorecheck\/\">tagged &#8220;CppCoreCheck&#8221;<\/a>.<\/span><\/p>\n<p>The C++ Core Guidelines is an ever-evolving document that currently contains 482 rules, however only 263 of these provide guides that are enforceable by static analysis (Enforceable Set). At the time of writing, C++ Core Check covers 67 rules from the Enforceable Set. We are actively expanding the coverage as well as fixing issues raised on the <a href=\"https:\/\/developercommunity.visualstudio.com\/spaces\/62\/index.html\">Developer Community<\/a>\u00a0page.<\/p>\n<p><sup>1<\/sup>\u00a0This excludes rules that are philosophical, code-style based rules, rules marked as &#8220;impossible to enforce&#8221;, or those that are meant to be interpreted and enforced by each codebase&#8217;s maintainers.<\/p>\n<p>&nbsp;<\/p>\n<h3>Mapping of C++ Core Guidelines rules to C++ Core Check warnings<\/h3>\n<h4><a href=\"https:\/\/github.com\/isocpp\/CppCoreGuidelines\/blob\/master\/CppCoreGuidelines.md#prosafety-type-safety-profile\">Type Profile<\/a><\/h4>\n<table>\n<tbody>\n<tr>\n<td width=\"193\"><strong>C++ Core Guidelines Rule<\/strong><\/td>\n<td width=\"196\"><strong>C++ Core Check warning(s)<\/strong><\/td>\n<\/tr>\n<tr>\n<td width=\"193\">Type.1<\/td>\n<td width=\"196\"><a href=\"https:\/\/docs.microsoft.com\/en-us\/cpp\/code-quality\/C26471\">C26471<\/a>, <a href=\"https:\/\/docs.microsoft.com\/en-us\/cpp\/code-quality\/C26472\">C26472<\/a>, <a href=\"https:\/\/docs.microsoft.com\/en-us\/cpp\/code-quality\/C26473\">C26473<\/a>, <a href=\"https:\/\/docs.microsoft.com\/en-us\/cpp\/code-quality\/C26474\">C26474<\/a>, <a href=\"https:\/\/docs.microsoft.com\/en-us\/cpp\/code-quality\/C26490\">C26490<\/a><\/td>\n<\/tr>\n<tr>\n<td width=\"193\">Type.2<\/td>\n<td width=\"196\"><a href=\"https:\/\/docs.microsoft.com\/en-us\/cpp\/code-quality\/C26466\">C26466<\/a>, <a href=\"https:\/\/docs.microsoft.com\/en-us\/cpp\/code-quality\/C26491\">C26491<\/a><\/td>\n<\/tr>\n<tr>\n<td width=\"193\">Type.3<\/td>\n<td width=\"196\"><a href=\"https:\/\/docs.microsoft.com\/en-us\/cpp\/code-quality\/C26465\">C26465<\/a>, <a href=\"https:\/\/docs.microsoft.com\/en-us\/cpp\/code-quality\/C26492\">C26492<\/a><\/td>\n<\/tr>\n<tr>\n<td width=\"193\">Type.4<\/td>\n<td width=\"196\"><a href=\"https:\/\/docs.microsoft.com\/en-us\/cpp\/code-quality\/C26493\">C26493<\/a><\/td>\n<\/tr>\n<tr>\n<td width=\"193\">Type.5<\/td>\n<td width=\"196\"><a href=\"https:\/\/docs.microsoft.com\/en-us\/cpp\/code-quality\/C26494\">C26494<\/a><\/td>\n<\/tr>\n<tr>\n<td width=\"193\">Type.6<\/td>\n<td width=\"196\"><a href=\"https:\/\/docs.microsoft.com\/en-us\/cpp\/code-quality\/C26495\">C26495<\/a><\/td>\n<\/tr>\n<tr>\n<td width=\"193\">Type.7<\/td>\n<td width=\"196\"><a href=\"https:\/\/docs.microsoft.com\/en-us\/cpp\/code-quality\/C26496\">C26496<\/a><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&nbsp;<\/p>\n<h4><a href=\"https:\/\/github.com\/isocpp\/CppCoreGuidelines\/blob\/master\/CppCoreGuidelines.md#probounds-bounds-safety-profile\">Bounds Profile<\/a><\/h4>\n<table>\n<tbody>\n<tr>\n<td width=\"193\"><strong>C++ Core Guidelines Rule<\/strong><\/td>\n<td width=\"196\"><strong>C++ Core Check warning(s)<\/strong><\/td>\n<\/tr>\n<tr>\n<td width=\"193\">Bounds.1<\/td>\n<td width=\"196\"><a href=\"https:\/\/docs.microsoft.com\/en-us\/cpp\/code-quality\/C26481\">C26481<\/a><\/td>\n<\/tr>\n<tr>\n<td width=\"193\">Bounds.2<\/td>\n<td width=\"196\"><a href=\"https:\/\/docs.microsoft.com\/en-us\/cpp\/code-quality\/C26482\">C26482<\/a>, <a href=\"https:\/\/docs.microsoft.com\/en-us\/cpp\/code-quality\/C26483\">C26483<\/a><\/td>\n<\/tr>\n<tr>\n<td width=\"193\">Bounds.3<\/td>\n<td width=\"196\"><a href=\"https:\/\/docs.microsoft.com\/en-us\/cpp\/code-quality\/C26485\">C26485<\/a><\/td>\n<\/tr>\n<tr>\n<td width=\"193\">Bounds.4<\/td>\n<td width=\"196\"><a href=\"https:\/\/docs.microsoft.com\/en-us\/cpp\/code-quality\/C26446\">C26446<\/a><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&nbsp;<\/p>\n<h4><a href=\"https:\/\/github.com\/isocpp\/CppCoreGuidelines\/blob\/master\/CppCoreGuidelines.md#prolifetime-lifetime-safety-profile\">Lifetimes Profile<\/a><\/h4>\n<table>\n<tbody>\n<tr>\n<td width=\"357\"><strong>C++ Core Guidelines Rule<\/strong><\/td>\n<td width=\"196\"><strong>C++ Core Check warning(s)<\/strong><\/td>\n<\/tr>\n<tr>\n<td width=\"357\">Lifetime.1<\/td>\n<td width=\"196\"><a href=\"https:\/\/docs.microsoft.com\/en-us\/cpp\/code-quality\/C26488\">C26488<\/a>, <a href=\"https:\/\/docs.microsoft.com\/en-us\/cpp\/code-quality\/C26489\">C26489<\/a>, <a href=\"https:\/\/docs.microsoft.com\/en-us\/cpp\/code-quality\/C26800\">C26800<\/a>, <a href=\"https:\/\/docs.microsoft.com\/en-us\/cpp\/code-quality\/C26810\">C26810<\/a>, <a href=\"https:\/\/docs.microsoft.com\/en-us\/cpp\/code-quality\/C26811\">C26811<\/a><\/td>\n<\/tr>\n<tr>\n<td width=\"357\">Lifetime.3<\/td>\n<td width=\"196\"><a href=\"https:\/\/docs.microsoft.com\/en-us\/cpp\/code-quality\/C26486\">C26486<\/a><\/td>\n<\/tr>\n<tr>\n<td width=\"357\">Lifetime.4<\/td>\n<td width=\"196\"><a href=\"https:\/\/docs.microsoft.com\/en-us\/cpp\/code-quality\/C26487\">C26487<\/a><\/td>\n<\/tr>\n<tr>\n<td width=\"357\">Lifetime.ptrtotemp<\/td>\n<td width=\"196\"><a href=\"https:\/\/docs.microsoft.com\/en-us\/cpp\/code-quality\/C26815\">C26815<\/a><\/td>\n<\/tr>\n<tr>\n<td width=\"357\">Lifetime.ptrtostack<\/td>\n<td width=\"196\"><a href=\"https:\/\/docs.microsoft.com\/en-us\/cpp\/code-quality\/C26816\">C26816<\/a><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&nbsp;<\/p>\n<h4><a href=\"https:\/\/github.com\/isocpp\/CppCoreGuidelines\/blob\/master\/CppCoreGuidelines.md#c-classes-and-class-hierarchies\">C: Classes and class hierarchy<\/a><\/h4>\n<table>\n<tbody>\n<tr>\n<td width=\"193\"><strong>C++ Core Guidelines Rule<\/strong><\/td>\n<td width=\"196\"><strong>C++ Core Check warning(s)<\/strong><\/td>\n<\/tr>\n<tr>\n<td width=\"193\">C.21<\/td>\n<td width=\"196\"><a href=\"https:\/\/docs.microsoft.com\/en-us\/cpp\/code-quality\/C26432\">C26432<\/a><\/td>\n<\/tr>\n<tr>\n<td width=\"193\">C.35<\/td>\n<td width=\"196\"><a href=\"https:\/\/docs.microsoft.com\/en-us\/cpp\/code-quality\/C26436\">C26436<\/a><\/td>\n<\/tr>\n<tr>\n<td width=\"193\">C.41<\/td>\n<td width=\"196\"><a href=\"https:\/\/docs.microsoft.com\/en-us\/cpp\/code-quality\/C26495\">C26495<\/a><\/td>\n<\/tr>\n<tr>\n<td width=\"193\">C.52<\/td>\n<td width=\"196\"><a href=\"https:\/\/docs.microsoft.com\/en-us\/cpp\/code-quality\/C26495\">C26495<\/a><\/td>\n<\/tr>\n<tr>\n<td width=\"193\">C.66<\/td>\n<td width=\"196\"><a href=\"https:\/\/docs.microsoft.com\/en-us\/cpp\/code-quality\/C26493\">C26493<\/a><\/td>\n<\/tr>\n<tr>\n<td width=\"193\">C.84<\/td>\n<td width=\"196\"><a href=\"https:\/\/docs.microsoft.com\/en-us\/cpp\/code-quality\/C26493\">C26493<\/a><\/td>\n<\/tr>\n<tr>\n<td width=\"193\">C.85<\/td>\n<td width=\"196\"><a href=\"https:\/\/docs.microsoft.com\/en-us\/cpp\/code-quality\/C26493\">C26493<\/a><\/td>\n<\/tr>\n<tr>\n<td width=\"193\">C.127<\/td>\n<td width=\"196\"><a href=\"https:\/\/docs.microsoft.com\/en-us\/cpp\/code-quality\/C26436\">C26436<\/a><\/td>\n<\/tr>\n<tr>\n<td width=\"193\">C.128<\/td>\n<td width=\"196\"><a href=\"https:\/\/docs.microsoft.com\/en-us\/cpp\/code-quality\/C26433\">C26433<\/a>, <a href=\"https:\/\/docs.microsoft.com\/en-us\/cpp\/code-quality\/C26434\">C26434<\/a>, <a href=\"https:\/\/docs.microsoft.com\/en-us\/cpp\/code-quality\/C26435\">C26435<\/a>, <a href=\"https:\/\/docs.microsoft.com\/en-us\/cpp\/code-quality\/C26443\">C26443<\/a>, <a href=\"https:\/\/docs.microsoft.com\/en-us\/cpp\/code-quality\/C26456\">C26456<\/a><\/td>\n<\/tr>\n<tr>\n<td width=\"193\">C.146<\/td>\n<td width=\"196\"><a href=\"https:\/\/docs.microsoft.com\/en-us\/cpp\/code-quality\/C26466\">C26466<\/a><\/td>\n<\/tr>\n<tr>\n<td width=\"193\">C.149<\/td>\n<td width=\"196\"><a href=\"https:\/\/docs.microsoft.com\/en-us\/cpp\/code-quality\/C26409\">C26409<\/a><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&nbsp;<\/p>\n<h4><a href=\"https:\/\/github.com\/isocpp\/CppCoreGuidelines\/blob\/master\/CppCoreGuidelines.md#con-constants-and-immutability\">Con: Constants and immutability<\/a><\/h4>\n<table width=\"623\">\n<tbody>\n<tr>\n<td width=\"312\"><strong>C++ Core Guidelines Rule<\/strong><\/td>\n<td width=\"312\"><strong>C++ Core Check warning(s)<\/strong><\/td>\n<\/tr>\n<tr>\n<td width=\"312\">Con.1<\/td>\n<td width=\"312\"><a href=\"https:\/\/docs.microsoft.com\/en-us\/cpp\/code-quality\/C26496\">C26496<\/a><\/td>\n<\/tr>\n<tr>\n<td width=\"312\">Con.3<\/td>\n<td width=\"312\"><a href=\"https:\/\/docs.microsoft.com\/en-us\/cpp\/code-quality\/C26460\">C26460<\/a>, <a href=\"https:\/\/docs.microsoft.com\/en-us\/cpp\/code-quality\/C26461\">C26461<\/a><\/td>\n<\/tr>\n<tr>\n<td width=\"312\">Con.4<\/td>\n<td width=\"312\"><a href=\"https:\/\/docs.microsoft.com\/en-us\/cpp\/code-quality\/C26462\">C26462<\/a>, <a href=\"https:\/\/docs.microsoft.com\/en-us\/cpp\/code-quality\/C26463\">C26463<\/a>, <a href=\"https:\/\/docs.microsoft.com\/en-us\/cpp\/code-quality\/C26464\">C26464<\/a>, <a href=\"https:\/\/docs.microsoft.com\/en-us\/cpp\/code-quality\/C26496\">C26496<\/a><\/td>\n<\/tr>\n<tr>\n<td width=\"312\">Con.5<\/td>\n<td width=\"312\"><a href=\"https:\/\/docs.microsoft.com\/en-us\/cpp\/code-quality\/C26498\">C26498<\/a>, <a href=\"https:\/\/docs.microsoft.com\/en-us\/cpp\/code-quality\/C26814\">C26814<\/a><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&nbsp;<\/p>\n<h4><a href=\"https:\/\/github.com\/isocpp\/CppCoreGuidelines\/blob\/master\/CppCoreGuidelines.md#cpcon-concurrency\">CP.con: Concurrency<\/a><\/h4>\n<table>\n<tbody>\n<tr>\n<td width=\"288\"><strong>C++ Core Guidelines Rule<\/strong><\/td>\n<td width=\"288\"><strong>C++ Core Check warning<\/strong><\/td>\n<\/tr>\n<tr>\n<td width=\"288\">CP.44<\/td>\n<td width=\"288\"><a href=\"https:\/\/docs.microsoft.com\/en-us\/cpp\/code-quality\/C26441\">C26441<\/a><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&nbsp;<\/p>\n<h4><a href=\"https:\/\/github.com\/isocpp\/CppCoreGuidelines\/blob\/master\/CppCoreGuidelines.md#e-error-handling\">E: Error handling<\/a><\/h4>\n<table>\n<tbody>\n<tr>\n<td width=\"288\"><strong>C++ Core Guidelines Rule<\/strong><\/td>\n<td width=\"288\"><strong>C++ Core Check warning<\/strong><\/td>\n<\/tr>\n<tr>\n<td width=\"288\">E.16<\/td>\n<td width=\"288\"><a href=\"https:\/\/docs.microsoft.com\/en-us\/cpp\/code-quality\/C26495\">C26495<\/a><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&nbsp;<\/p>\n<h4><a href=\"https:\/\/github.com\/isocpp\/CppCoreGuidelines\/blob\/master\/CppCoreGuidelines.md#enum-enumerations\">Enum: Enumerations<\/a><\/h4>\n<table>\n<tbody>\n<tr>\n<td width=\"288\"><strong>C++ Core Guidelines Rule<\/strong><\/td>\n<td width=\"288\"><strong>C++ Core Check warning<\/strong><\/td>\n<\/tr>\n<tr>\n<td width=\"288\">Enum.3<\/td>\n<td width=\"288\"><a href=\"https:\/\/docs.microsoft.com\/en-us\/cpp\/code-quality\/C26812\">C26812<\/a><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&nbsp;<\/p>\n<h4><a href=\"https:\/\/github.com\/isocpp\/CppCoreGuidelines\/blob\/master\/CppCoreGuidelines.md#es-expressions-and-statements\">ES: Expressions and statements<\/a><\/h4>\n<table>\n<tbody>\n<tr>\n<td width=\"288\"><strong>C++ Core Guidelines Rule<\/strong><\/td>\n<td width=\"288\"><strong>C++ Core Check warning<\/strong><\/td>\n<\/tr>\n<tr>\n<td width=\"288\">ES.24<\/td>\n<td width=\"288\"><a href=\"https:\/\/docs.microsoft.com\/en-us\/cpp\/code-quality\/C26409\">C26409<\/a><\/td>\n<\/tr>\n<tr>\n<td width=\"288\">ES.25<\/td>\n<td width=\"288\"><a href=\"https:\/\/docs.microsoft.com\/en-us\/cpp\/code-quality\/C26462\">C26462<\/a><\/td>\n<\/tr>\n<tr>\n<td width=\"288\">ES.46<\/td>\n<td width=\"288\">Compiler warning: C4244<\/td>\n<\/tr>\n<tr>\n<td width=\"288\">ES.47<\/td>\n<td width=\"288\"><a href=\"https:\/\/docs.microsoft.com\/en-us\/cpp\/code-quality\/C26477\">C26477<\/a><\/td>\n<\/tr>\n<tr>\n<td width=\"288\">ES.49<\/td>\n<td width=\"288\"><a href=\"https:\/\/docs.microsoft.com\/en-us\/cpp\/code-quality\/C26475\">C26475<\/a><\/td>\n<\/tr>\n<tr>\n<td width=\"288\">ES.50<\/td>\n<td width=\"288\"><a href=\"https:\/\/docs.microsoft.com\/en-us\/cpp\/code-quality\/C26492\">C26492<\/a><\/td>\n<\/tr>\n<tr>\n<td width=\"288\">ES.56<\/td>\n<td width=\"288\"><a href=\"https:\/\/docs.microsoft.com\/en-us\/cpp\/code-quality\/C26478\">C26478<\/a><\/td>\n<\/tr>\n<tr>\n<td width=\"288\">ES.60<\/td>\n<td width=\"288\"><a href=\"https:\/\/docs.microsoft.com\/en-us\/cpp\/code-quality\/C26409\">C26409<\/a><\/td>\n<\/tr>\n<tr>\n<td width=\"288\">ES.61<\/td>\n<td width=\"288\"><a href=\"https:\/\/docs.microsoft.com\/en-us\/cpp\/code-quality\/C26409\">C26409<\/a><\/td>\n<\/tr>\n<tr>\n<td width=\"288\">ES.63<\/td>\n<td width=\"288\"><a href=\"https:\/\/docs.microsoft.com\/en-us\/cpp\/code-quality\/C26437\">C26437<\/a><\/td>\n<\/tr>\n<tr>\n<td width=\"288\">ES.65<\/td>\n<td width=\"288\">See Lifetimes.1<\/td>\n<\/tr>\n<tr>\n<td width=\"288\">ES.71<\/td>\n<td width=\"288\"><a href=\"https:\/\/docs.microsoft.com\/en-us\/cpp\/code-quality\/C26817\">C26817<\/a><\/td>\n<\/tr>\n<tr>\n<td width=\"288\">ES.76<\/td>\n<td width=\"288\"><a href=\"https:\/\/docs.microsoft.com\/en-us\/cpp\/code-quality\/C26438\">C26438<\/a><\/td>\n<\/tr>\n<tr>\n<td width=\"288\">ES.78<\/td>\n<td width=\"288\"><a href=\"https:\/\/docs.microsoft.com\/en-us\/cpp\/code-quality\/C26819\">C26819<\/a><\/td>\n<\/tr>\n<tr>\n<td width=\"288\">ES.79<\/td>\n<td width=\"288\"><a href=\"https:\/\/docs.microsoft.com\/en-us\/cpp\/code-quality\/C26818\">C26818<\/a><\/td>\n<\/tr>\n<tr>\n<td width=\"288\">ES.84<\/td>\n<td width=\"288\"><a href=\"https:\/\/docs.microsoft.com\/en-us\/cpp\/code-quality\/C26444\">C26444<\/a><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&nbsp;<\/p>\n<h4><a href=\"https:\/\/github.com\/isocpp\/CppCoreGuidelines\/blob\/master\/CppCoreGuidelines.md#f-functions\">F: Functions<\/a><\/h4>\n<table>\n<tbody>\n<tr>\n<td width=\"288\"><strong>C++ Core Guidelines Rule<\/strong><\/td>\n<td width=\"288\"><strong>C++ Core Check warning(s)<\/strong><\/td>\n<\/tr>\n<tr>\n<td width=\"288\">F.4<\/td>\n<td width=\"288\"><a href=\"https:\/\/docs.microsoft.com\/en-us\/cpp\/code-quality\/C26497\">C26497<\/a><\/td>\n<\/tr>\n<tr>\n<td width=\"288\">F.6<\/td>\n<td width=\"288\"><a href=\"https:\/\/docs.microsoft.com\/en-us\/cpp\/code-quality\/C26439\">C26439<\/a>, <a href=\"https:\/\/docs.microsoft.com\/en-us\/cpp\/code-quality\/C26440\">C26440<\/a>, <a href=\"https:\/\/docs.microsoft.com\/en-us\/cpp\/code-quality\/C26447\">C26447<\/a><\/td>\n<\/tr>\n<tr>\n<td width=\"288\">F.23<\/td>\n<td width=\"288\"><a href=\"https:\/\/docs.microsoft.com\/en-us\/cpp\/code-quality\/C26429\">C26429<\/a>, <a href=\"https:\/\/docs.microsoft.com\/en-us\/cpp\/code-quality\/C26430\">C26430<\/a>, <a href=\"https:\/\/docs.microsoft.com\/en-us\/cpp\/code-quality\/C26431\">C26431<\/a><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&nbsp;<\/p>\n<h4><a href=\"https:\/\/github.com\/isocpp\/CppCoreGuidelines\/blob\/master\/CppCoreGuidelines.md#i-interfaces\">I: Interfaces<\/a><\/h4>\n<table>\n<tbody>\n<tr>\n<td width=\"288\"><strong>C++ Core Guidelines Rule<\/strong><\/td>\n<td width=\"288\"><strong>C++ Core Check warning(s)<\/strong><\/td>\n<\/tr>\n<tr>\n<td width=\"288\">I.11<\/td>\n<td width=\"288\"><a href=\"https:\/\/docs.microsoft.com\/en-us\/cpp\/code-quality\/C26400\">C26400<\/a>, <a href=\"https:\/\/docs.microsoft.com\/en-us\/cpp\/code-quality\/C26401\">C26401<\/a><\/td>\n<\/tr>\n<tr>\n<td width=\"288\">I.22<\/td>\n<td width=\"288\"><a href=\"https:\/\/docs.microsoft.com\/en-us\/cpp\/code-quality\/C26426\">C26426<\/a>, <a href=\"https:\/\/docs.microsoft.com\/en-us\/cpp\/code-quality\/C26427\">C26427<\/a><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&nbsp;<\/p>\n<h4><a href=\"https:\/\/github.com\/isocpp\/CppCoreGuidelines\/blob\/master\/CppCoreGuidelines.md#p-philosophy\">P: Philosophy<\/a><\/h4>\n<table>\n<tbody>\n<tr>\n<td width=\"288\"><strong>C++ Core Guidelines Rule<\/strong><\/td>\n<td width=\"288\"><strong>C++ Core Check warning<\/strong><\/td>\n<\/tr>\n<tr>\n<td width=\"288\">P.9<\/td>\n<td width=\"288\"><a href=\"https:\/\/docs.microsoft.com\/en-us\/cpp\/code-quality\/C26820\">C26820<\/a><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&nbsp;<\/p>\n<h4><a href=\"https:\/\/github.com\/isocpp\/CppCoreGuidelines\/blob\/master\/CppCoreGuidelines.md#r-resource-management\">R: Resource management<\/a><\/h4>\n<table>\n<tbody>\n<tr>\n<td width=\"288\"><strong>C++ Core Guidelines Rule<\/strong><\/td>\n<td width=\"288\"><strong>C++ Core Check warning<\/strong><\/td>\n<\/tr>\n<tr>\n<td width=\"288\">R.3<\/td>\n<td width=\"288\"><a href=\"https:\/\/docs.microsoft.com\/en-us\/cpp\/code-quality\/C26402\">C26402<\/a>, <a href=\"https:\/\/docs.microsoft.com\/en-us\/cpp\/code-quality\/C26403\">C26403<\/a>, <a href=\"https:\/\/docs.microsoft.com\/en-us\/cpp\/code-quality\/C26404\">C26404<\/a>, <a href=\"https:\/\/docs.microsoft.com\/en-us\/cpp\/code-quality\/C26406\">C26406<\/a><\/td>\n<\/tr>\n<tr>\n<td width=\"288\">R.5<\/td>\n<td width=\"288\"><a href=\"https:\/\/docs.microsoft.com\/en-us\/cpp\/code-quality\/C26407\">C26407<\/a>, <a href=\"https:\/\/docs.microsoft.com\/en-us\/cpp\/code-quality\/C26414\">C26414<\/a><\/td>\n<\/tr>\n<tr>\n<td width=\"288\">R.10<\/td>\n<td width=\"288\"><a href=\"https:\/\/docs.microsoft.com\/en-us\/cpp\/code-quality\/C26408\">C26408<\/a><\/td>\n<\/tr>\n<tr>\n<td width=\"288\">R.11<\/td>\n<td width=\"288\"><a href=\"https:\/\/docs.microsoft.com\/en-us\/cpp\/code-quality\/C26409\">C26409<\/a><\/td>\n<\/tr>\n<tr>\n<td width=\"288\">R.20<\/td>\n<td width=\"288\"><a href=\"https:\/\/docs.microsoft.com\/en-us\/cpp\/code-quality\/C26409\">C26409<\/a><\/td>\n<\/tr>\n<tr>\n<td width=\"288\">R.23<\/td>\n<td width=\"288\"><a href=\"https:\/\/docs.microsoft.com\/en-us\/cpp\/code-quality\/C26409\">C26409<\/a><\/td>\n<\/tr>\n<tr>\n<td width=\"288\">R.30<\/td>\n<td width=\"288\"><a href=\"https:\/\/docs.microsoft.com\/en-us\/cpp\/code-quality\/C26415\">C26415<\/a><\/td>\n<\/tr>\n<tr>\n<td width=\"288\">R.32<\/td>\n<td width=\"288\"><a href=\"https:\/\/docs.microsoft.com\/en-us\/cpp\/code-quality\/C26410\">C26410<\/a><\/td>\n<\/tr>\n<tr>\n<td width=\"288\">R.33<\/td>\n<td width=\"288\"><a href=\"https:\/\/docs.microsoft.com\/en-us\/cpp\/code-quality\/C26411\">C26411<\/a><\/td>\n<\/tr>\n<tr>\n<td width=\"288\">R.34<\/td>\n<td width=\"288\"><a href=\"https:\/\/docs.microsoft.com\/en-us\/cpp\/code-quality\/C26416\">C26416<\/a><\/td>\n<\/tr>\n<tr>\n<td width=\"288\">R.35<\/td>\n<td width=\"288\"><a href=\"https:\/\/docs.microsoft.com\/en-us\/cpp\/code-quality\/C26417\">C26417<\/a><\/td>\n<\/tr>\n<tr>\n<td width=\"288\">R.36<\/td>\n<td width=\"288\"><a href=\"https:\/\/docs.microsoft.com\/en-us\/cpp\/code-quality\/C26418\">C26418<\/a><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&nbsp;<\/p>\n<p>Additionally, C++ Core Check also publishes a few rules that do not directly map to the C++ Core Guidelines.<\/p>\n<table>\n<tbody>\n<tr>\n<td width=\"288\"><strong>C++ Core Guidelines Inspired Rule<\/strong><\/td>\n<td width=\"288\"><strong>C++ Core Check warning<\/strong><\/td>\n<\/tr>\n<tr>\n<td width=\"288\">GSL.view<\/td>\n<td width=\"288\"><a href=\"https:\/\/docs.microsoft.com\/en-us\/cpp\/code-quality\/C26445\">C26445<\/a>, <a href=\"https:\/\/docs.microsoft.com\/en-us\/cpp\/code-quality\/C26449\">C26449<\/a><\/td>\n<\/tr>\n<tr>\n<td width=\"288\">GSL.util<\/td>\n<td width=\"288\"><a href=\"https:\/\/docs.microsoft.com\/en-us\/cpp\/code-quality\/C26448\">C26448<\/a><\/td>\n<\/tr>\n<tr>\n<td width=\"288\">Io.1<\/td>\n<td width=\"288\"><a href=\"https:\/\/docs.microsoft.com\/en-us\/cpp\/code-quality\/C26450\">C26450<\/a><\/td>\n<\/tr>\n<tr>\n<td width=\"288\">Io.2<\/td>\n<td width=\"288\"><a href=\"https:\/\/docs.microsoft.com\/en-us\/cpp\/code-quality\/C26451\">C26451<\/a><\/td>\n<\/tr>\n<tr>\n<td width=\"288\">Io.3<\/td>\n<td width=\"288\"><a href=\"https:\/\/docs.microsoft.com\/en-us\/cpp\/code-quality\/C26452\">C26452<\/a><\/td>\n<\/tr>\n<tr>\n<td width=\"288\">Io.4<\/td>\n<td width=\"288\"><a href=\"https:\/\/docs.microsoft.com\/en-us\/cpp\/code-quality\/C26453\">C26453<\/a><\/td>\n<\/tr>\n<tr>\n<td width=\"288\">Io.5<\/td>\n<td width=\"288\"><a href=\"https:\/\/docs.microsoft.com\/en-us\/cpp\/code-quality\/C26454\">C26454<\/a><\/td>\n<\/tr>\n<tr>\n<td width=\"288\">STL.1<\/td>\n<td width=\"288\"><a href=\"https:\/\/docs.microsoft.com\/en-us\/cpp\/code-quality\/C26459\">C26459<\/a><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&nbsp;<\/p>\n<p>All of these rules are available in Visual Studio. The checkers from the &#8220;Microsoft Native Recommended Rules&#8221; ruleset already appear in-editor in the form of green squiggles: see <a href=\"https:\/\/aka.ms\/cpp\/ca\/bg\">in-editor code analysis<\/a>.<\/p>\n<p><img decoding=\"async\" class=\"alignnone size-full wp-image-26804\" src=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2020\/10\/editor-warning.png\" alt=\"Visual Studio Editor with C++ code and a Code analysis warning showing up as a squiggle\" width=\"1187\" height=\"249\" srcset=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2020\/10\/editor-warning.png 1187w, https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2020\/10\/editor-warning-300x63.png 300w, https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2020\/10\/editor-warning-1024x215.png 1024w, https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2020\/10\/editor-warning-768x161.png 768w\" sizes=\"(max-width: 1187px) 100vw, 1187px\" \/><\/p>\n<p><span style=\"font-size: 1rem;\">To run the C++ Core Check rules, navigate to the project properties dialog and select the &#8220;C++ Core Check rules&#8221; in the Code analysis pane.<\/span><\/p>\n<p><img decoding=\"async\" class=\"alignnone size-full wp-image-26805\" src=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2020\/10\/property-pages.png\" alt=\"Image property pages\" width=\"954\" height=\"570\" srcset=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2020\/10\/property-pages.png 954w, https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2020\/10\/property-pages-300x179.png 300w, https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2020\/10\/property-pages-768x459.png 768w\" sizes=\"(max-width: 954px) 100vw, 954px\" \/><\/p>\n<p><span style=\"font-size: 1rem;\">For more information about the various rulesets and configuring them please visit <\/span><a style=\"background-color: #f7f7f9; font-size: 1rem;\" href=\"https:\/\/docs.microsoft.com\/en-us\/visualstudio\/code-quality\/quick-start-code-analysis-for-c-cpp\">Quickstart: Code analysis for C\/C++<\/a><span style=\"font-size: 1rem;\">.<\/span><\/p>\n<h3>Next steps:<\/h3>\n<p>If there are any rules you&#8217;d like to see added, please visit the <a href=\"https:\/\/developercommunity.visualstudio.com\/content\/idea\/post.html?space=62\">Suggest a Feature<\/a> page and tag your rule C++ Core Check. See the <a href=\"https:\/\/docs.microsoft.com\/en-us\/cpp\/code-quality\/code-analysis-for-cpp-corecheck\">Microsoft Docs<\/a> page for in-depth examples and explanations for each of the warnings that C++ Core Check offers. We can be reached via the comments below or @VisualC on Twitter.<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>C++ Core Check is Microsoft\u2019s static analysis tool that enforces the rules from the C++ Core Guidelines, which is maintained by the C++ Foundation. This post is to provide a snapshot of the C++ Core Guidelines coverage that C++ Core Check offers. For background, the C++ team introduced C++ Core Check in December 2015 as [&hellip;]<\/p>\n","protected":false},"author":6068,"featured_media":26823,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[119,245,163],"class_list":["post-26726","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-cplusplus","tag-code-analysis","tag-cppcorecheck","tag-static-analysis"],"acf":[],"blog_post_summary":"<p>C++ Core Check is Microsoft\u2019s static analysis tool that enforces the rules from the C++ Core Guidelines, which is maintained by the C++ Foundation. This post is to provide a snapshot of the C++ Core Guidelines coverage that C++ Core Check offers. For background, the C++ team introduced C++ Core Check in December 2015 as [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/posts\/26726","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/users\/6068"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/comments?post=26726"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/posts\/26726\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/media\/26823"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/media?parent=26726"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/categories?post=26726"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/tags?post=26726"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}