@shafik@hachyderm.io Profile picture
Compiler Engineer clang front end. Interests: C++, C, and undefined behavior. Martial Artist, Book Worm and Dad. @shafik@hachyderm.io he/him

Jan 24, 2021, 20 tweets

#102 The result of an infinite recursion in template instantiation is undefined behavior: eel.is/c++draft/temp.…

godbolt: godbolt.org/z/jh6bsr

#103 Referring to any non-static member or base class of an object in the handler for a function-try-block of a
constructor or destructor for that object results in undefined behavior: eel.is/c++draft/excep…

godbolt: godbolt.org/z/6Yzvvc

#104 If the token defined is generated as a result of this replacement process or use of
the defined unary operator does not match one of the two specified forms prior to macro replacement, the
behavior is undefined: eel.is/c++draft/cpp.c…

godbolt: godbolt.org/z/xrdfT4

#105 If there are sequences of preprocessing tokens within the list of arguments to a function-like macro
that would otherwise act as preprocessing directives, the behavior is undefined: eel.is/c++draft/cpp.r…

godbolt: godbolt.org/z/6hfxn5

#106 If an invalid character results from using the stringize operator the behavior is undefined: eel.is/c++draft/cpp.s…

godbolt: godbolt.org/z/jsYbqP

#107 If an invalid preprocessing token results from using the concat operator the behavior is undefined: eel.is/c++draft/cpp.c…

godbolt: godbolt.org/z/bqxMKe

#108 Using 0 or a number greater than 2147483647 is undefined behavior for #line directive: eel.is/c++draft/cpp.l…

godbolt: godbolt.org/z/ccxcvW

#109 When using the pptoken variant of the #line directive, If the directive resulting after all replacements does not match one of the two previous forms, the behavior is undefined.: eel.is/c++draft/cpp.l…

godbolt: godbolt.org/z/E5qvaa

#110 If any of the pre-defined macro names in [cpp.predefined], or the identifier defined, is the subject of a #define or a #undef preprocessing directive, the behavior is undefined: eel.is/c++draft/cpp.p…

godbolt: godbolt.org/z/vEY5hz

#111 Twist on use of indeterminate value causing undefined behavior.

Using an indeterminate value in a return statement causes the whole branch to be ignored and we just use the return statement at the end.

h/t @rep_stosq_void

godbolt: gcc.godbolt.org/z/nrjaa1

#112 Falling off the end of a coroutine function body that does not return void is undefined behavior: eel.is/c++draft/stmt.…

godbolt: godbolt.org/z/5MTcnz

#113 Invoking a resumption member function for a coroutine that is not suspended results in undefined behavior: eel.is/c++draft/dcl.f…

godbolt: godbolt.org/z/W4PYfdPh4

#114 Invoking destroy() on a coroutine that is not suspended is undefined behavior: eel.is/c++draft/dcl.f…

godbolt: godbolt.org/z/3sWf3czPs

#115 Calling a function through an expression whose function type is different from the function type of the called function’s definition results in undefined behavior: godbolt.org/z/snjzbh6oc

[expr.call]p6 eel.is/c++draft/expr.…

#116 If the substitution of template arguments into a requirement would always result in a substitution failure, the program is ill-formed; no diagnostic required: godbolt.org/z/eez98bfT5

[expr.prim.req]p5 eel.is/c++draft/expr.…

#117 If, during parsing, lookup finds that a name in a template argument is bound to (part of) the declaration being parsed, the program is ill-formed. No diagnostic is required: godbolt.org/z/z354fnYGa

[stmt.ambig]p3 eel.is/c++draft/stmt.…

#118 If no arguments to a constexpr function allow it to be used in a core constant expression context,
the program is ill-formed, no diagnostic required: godbolt.org/z/MdnsWe69E

[dcl.constexpr]p6 eel.is/c++draft/dcl.c…

#119 If no specialization of
the template would satisfy the requirements for a constexpr function when considered as a non-template
function, the template is ill-formed, no diagnostic required: godbolt.org/z/8rMd18rPj

[dcl.constexpr]p7 eel.is/c++draft/dcl.c…

#120 If constinit is applied to any decl of a var, it shall be applied to the initializing decl. No diagnostic is required if no constinit declaration is reachable at the point of the initializing declaration: godbolt.org/z/bWMaTh8Ed

[dcl.constinit]p1 eel.is/c++draft/dcl.c…

#121 Some identifiers are reserved for use by C++ implementations and shall not be used otherwise; no
diagnostic is required: godbolt.org/z/658K4djY3

[lex.name]p3 eel.is/c++draft/lex.n…

Share this Scrolly Tale with your friends.

A Scrolly Tale is a new way to read Twitter threads with a more visually immersive experience.
Discover more beautiful Scrolly Tales like this.

Keep scrolling