[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"detail-sidebar-cat-0-en-105":3,"doc-seo-515715-105":59,"doc-detail-515715-en":134},{"code":4,"msg":5,"data":6},0,"success",[7,13,18,23,28,33,38,43,48,51,55],{"id":8,"doc_module":4,"doc_module_name":9,"category_name":10,"show_sort_weight":11,"slug":12},1,"Document","Story & Novel",90,"story-novel",{"id":14,"doc_module":4,"doc_module_name":9,"category_name":15,"show_sort_weight":16,"slug":17},2,"Literature",80,"literature",{"id":19,"doc_module":4,"doc_module_name":9,"category_name":20,"show_sort_weight":21,"slug":22},4,"Exam",70,"exam",{"id":24,"doc_module":4,"doc_module_name":9,"category_name":25,"show_sort_weight":26,"slug":27},5,"Comic",60,"comic",{"id":29,"doc_module":4,"doc_module_name":9,"category_name":30,"show_sort_weight":31,"slug":32},6,"Technology",50,"technology",{"id":34,"doc_module":4,"doc_module_name":9,"category_name":35,"show_sort_weight":36,"slug":37},7,"Healthcare",40,"healthcare",{"id":39,"doc_module":4,"doc_module_name":9,"category_name":40,"show_sort_weight":41,"slug":42},8,"Research & Report",30,"research-report",{"id":44,"doc_module":4,"doc_module_name":9,"category_name":45,"show_sort_weight":46,"slug":47},9,"Religion & Spirituality",20,"religion-spirituality",{"id":46,"doc_module":4,"doc_module_name":9,"category_name":49,"show_sort_weight":46,"slug":50},"World Cup","world-cup",{"id":52,"doc_module":4,"doc_module_name":9,"category_name":53,"show_sort_weight":52,"slug":54},10,"Lifestyle","lifestyle",{"id":56,"doc_module":4,"doc_module_name":9,"category_name":57,"show_sort_weight":24,"slug":58},19,"General","general",{"code":4,"msg":60,"data":61},"ok",{"site_id":62,"language":63,"slug":64,"title":65,"keywords":66,"description":67,"schema_data":68,"social_meta":127,"head_meta":129,"extra_data":131,"updated_unix":133},105,"en","a-framework-for-systematically-addressing-undefined-behaviour-in-the-c-standard-r5-revision-history-update","A Framework for Systematically Addressing Undefined Behaviour in the C++ Standard - R5 - Revision History Update","","A framework enumerates all core language cases of undefined behaviour explicitly specified in the C++ Standard, groups them into ten categories, and classifies them using multiple relevant criteria. It proposes a holistic strategy to detect, mitigate, and ultimately eliminate undefined behaviour, built on feature removal, refined and erroneous behaviour, runtime checks, language subsetting, annotations, and new language features. Runtime checks are introduced through implicit contract assertions, enabling controlled handling and replacement with well-defined erroneous behaviour where execution can safely continue.",{"@graph":69,"@context":126},[70,84,105],{"@type":71,"itemListElement":72},"BreadcrumbList",[73,77,79,82],{"item":74,"name":75,"@type":76,"position":8},"https://docshare.wps.com","Home","ListItem",{"item":78,"name":9,"@type":76,"position":14},"https://docshare.wps.com/document/",{"item":80,"name":40,"@type":76,"position":81},"https://docshare.wps.com/document/research-report/",3,{"item":83,"name":65,"@type":76,"position":19},"https://docshare.wps.com/document/a-framework-for-systematically-addressing-undefined-behaviour-in-the-c-standard-r5-revision-history-update/515715/",{"url":83,"name":65,"@type":85,"image":86,"author":91,"headline":65,"publisher":94,"fileFormat":97,"inLanguage":63,"description":67,"dateModified":98,"datePublished":99,"encodingFormat":97,"isAccessibleForFree":100,"interactionStatistic":101},"DigitalDocument",{"url":87,"@type":88,"width":89,"height":90},"https://docshare.wps.com/thumbnails/a-framework-for-systematically-addressing-undefined-behaviour-in-the-c-standard-r5-revision-history-update/515715.png","ImageObject",300,407,{"name":92,"@type":93},"Angel","Person",{"url":74,"name":95,"@type":96},"DocShare","Organization","application/pdf","2026-11-16","2026-10-06",true,{"@type":102,"interactionType":103,"userInteractionCount":39},"InteractionCounter",{"@type":104},"ViewAction",{"@type":106,"mainEntity":107},"FAQPage",[108,114,118,122],{"name":109,"@type":110,"acceptedAnswer":111},"What does the paper enumerate and how is it organized?","Question",{"text":112,"@type":113},"It enumerates all core language undefined behaviour cases explicitly specified in the C++ Standard, then groups them into ten categories and classifies them using relevant criteria.","Answer",{"name":115,"@type":110,"acceptedAnswer":116},"What core strategy does the paper propose to handle undefined behaviour?",{"text":117,"@type":113},"It proposes a holistic approach to systematically detect, mitigate, and eliminate undefined behaviour using tools such as feature removal, refined and erroneous behaviour, runtime checks, language subsetting, annotations, and new language features.",{"name":119,"@type":110,"acceptedAnswer":120},"How do runtime checks work in this framework?",{"text":121,"@type":113},"Runtime checks are introduced via implicit contract assertions, giving users control over the impact on programs; when possible, undefined behaviour is replaced by well-defined erroneous behaviour to allow continued execution after a violated assertion.",{"name":123,"@type":110,"acceptedAnswer":124},"What guidance is provided for future work beyond the current proposal?",{"text":125,"@type":113},"The paper outlines future extensions, including identifying the UB category, adding granular control of evaluation semantics, and integrating assertions and assumptions across the language specification.","https://schema.org",{"og:url":83,"og:type":128,"og:title":65,"og:site_name":95,"og:description":67},"article",{"robots":130,"canonical":83},"index,follow",{"doc_id":132,"site_id":62},515715,1791414631,{"code":4,"msg":5,"data":135},{"doc_id":132,"user_id":136,"nickname":92,"user_avatar":137,"doc_module":4,"category_id":39,"category_name":40,"doc_title":65,"doc_description":67,"doc_content":138,"file_id":139,"file_url":140,"file_type":141,"file_size":142,"view_count":39,"is_deleted":4,"is_public":8,"is_downloadable":8,"audit_status":8,"page_count":143,"language":144,"language_code":63,"site_id":62,"html_lang":63,"table_of_contents":145,"faqs":146,"seo_title":147,"seo_description":67,"update_tm":148,"read_time":149,"preview_page_count":29,"preview_urls":150},687207412472,"https://ap-avatar.wpscdn.com/davatar_155a257f0dc6eb9ab79c44ca47cae57d","A framework for systematically addressing undefined behaviour in the C++ Standard  \nTimur Doumler ([papers@timur.audio](papers@timur.audio))  \nJoshua Berne ([jberne4@bloomberg.net](jberne4@bloomberg.net))  \nDocument \\#: D3100R5 Date: 2025-11-07  \nProject: Programming Language C++  \nAudience: EWG  \nAbstract  \nIn this paper, we enumerate all cases of core language undefined behaviour explicitly specified in the C++ Standard, group them into ten categories, and classify them along a number of relevant criteria.  \nWe then present a holistic strategy for systematically detecting, mitigating, and ultimately eliminating such undefined behaviour from the C++ Standard. This strategy is built on top of seven basic tools: feature removal, refined behaviour, erroneous behaviour, insertion of runtime checks, language subsetting, the introduction of annotations, and the introduction of entirely new language features. We discuss which tools are applicable to which cases of core language undefined behaviour.  \nWe find that two of these tools—erroneous behaviour and runtime checks—are applicable toa wide range of existing cases and do not require any source changes. We describe how runtime checks can be systematically introduced via implicit contract assertions, giving users complete control over what impact that undefined behaviour has on their programs. In addition to runtime checking, we replace undefined behaviour with erroneous, but well-defined behaviour that allows the program to continue execution past a violated implicit contract assertion wherever possible.  \nBuilding on Contracts as adopted for C++26, we provide a generic framework for applying these two techniques across the entire C++ language specification, fundamentally changing the landscape of how undefined behaviour is approached in C++ .  \nContents  \n1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3  \n2 Analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4  \n2. 1 Enumeration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4  \n2.1.1 Methodology . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4  \n2.1.2 Granularity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4  \n2.1.3 Scope   5  \n2.2 Classification . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6  \n2.2.1 Categories ...................................... 6  \n2.2.2 Relevance for security ................................ 8  \n2.3 Diagnosability . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8  \n2.3.1 Static vs. dynamic diagnosis ............................ 8  \n2.3.2 Locality of diagnosis ................................ 9  \n2.3.3 Cost of local diagnosis ............................... 10  \n2.3.4 Cost of non-local diagnosis ............................. 11  \n2.4 Existence of replacement behaviour   12  \n3 Strategy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14  \n3. 1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15  \n3.2 Scope   16  \n3.3 Tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16  \n3.3. 1 Feature removal . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16  \n3.3.2 Refined behaviour . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17  \n3.3.3 Erroneous behaviour . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17  \n3.3.4 Runtime checks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18  \n3.3.5 Language subsetting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18  \n3.3.6 Annotations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19  \n3.3.7 New features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ","cbCaigSUGD248ALm","https://ap.wps.com/l/cbCaigSUGD248ALm","pdf",882661,59,"English","# Introduction\n# Analysis\n## Enumeration\n## Classification\n## Diagnosability\n## Existence of replacement behaviour\n# Strategy\n## Overview\n## Tools\n# Proposed design\n## Defining implicit contract assertions\n## Applying implicit contract assertions\n## Defining replacement behaviour\n## Providing an escape hatch\n## Interaction with noexcept\n## Extending the library API\n# Proposed wording\n# Future extensions\n## Identifying the UB category\n## Granular control of the evaluation semantic\n## Integrating assertions and assumptions\n# Revision history","[{\"question\":\"What does the paper enumerate and how is it organized?\",\"answer\":\"It enumerates all core language undefined behaviour cases explicitly specified in the C++ Standard, then groups them into ten categories and classifies them using relevant criteria.\"},{\"question\":\"What core strategy does the paper propose to handle undefined behaviour?\",\"answer\":\"It proposes a holistic approach to systematically detect, mitigate, and eliminate undefined behaviour using tools such as feature removal, refined and erroneous behaviour, runtime checks, language subsetting, annotations, and new language features.\"},{\"question\":\"How do runtime checks work in this framework?\",\"answer\":\"Runtime checks are introduced via implicit contract assertions, giving users control over the impact on programs; when possible, undefined behaviour is replaced by well-defined erroneous behaviour to allow continued execution after a violated assertion.\"},{\"question\":\"What guidance is provided for future work beyond the current proposal?\",\"answer\":\"The paper outlines future extensions, including identifying the UB category, adding granular control of evaluation semantics, and integrating assertions and assumptions across the language specification.\"}]","A Framework for Systematically Addressing Undefined Behaviour in the C++ Standard - R5 - Revision History Update | PDF",1791321493,149,[151,155,159,163,167,171],{"page_no":8,"url":152,"width":153,"height":154},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-17/95772fe292e376c5050b4d2881a7ab38.webp",983,1390,{"page_no":14,"url":156,"width":157,"height":158},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-17/120835405697e9f67ec852ada153a99b.webp",982,1388,{"page_no":81,"url":160,"width":161,"height":162},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-17/0cdf70bb8c11d38cfe92ab70e6552966.webp",981,1387,{"page_no":19,"url":164,"width":165,"height":166},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-17/3c1f874993db82ea4b78c2aa00cd68ac.webp",980,1385,{"page_no":24,"url":168,"width":169,"height":170},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-17/2090c7fe10faafc43a129df9ce267fde.webp",979,1384,{"page_no":29,"url":172,"width":173,"height":174},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-17/01d8555d70c0174da6a58be78b44fb05.webp",978,1383]