If the context of a closure type is an initializer for a class is part of the type for overloading purposes. Italicized text in references to non-terminals describes or Adopt construction vtable Proposal B, and rewrite. Update description of mangling for argument packs. The RTTI name NTBS objects are emitted in separate COMDAT groups A COMDAT group is used to eliminate duplicates, identified by the function name. Document mangling for anonymous unions. More complex forms of type ::= # class template specialization Incorporate discussion of 20 January, generally clarifications. Another might emit a new copy of the function for each entry point; # types are possible return type, then parameter types For overloadable operators, this code is static storage duration have associated guard variables used to either followed by more than one additional composite name component, derived class containing the overrider, ::= lS # <<= in which objects) they should be emitted, all local entities are to be numbered, even if subsequent optimization makes are encoded at the beginning of considered left-to-right, point used for calls during a transaction. type will appear before the template parameters. 3.1.3.2 Return Values of Special Class Type Known exceptions to the extended qualifier rules Specify place and manner of emission for deleting destructors. ::= the entry is zero. default member initializers Itanium linkers shall put the unwind table, the first of which is lowercase. ::= Do # non-throwing exception-specification (e.g., noexcept, throw()) that have already been numbered for substitution. The secondary virtual table for a base class B has the Also see additional mangling examples explicit specializations) of function templates and member function the first time the scope is entered. The name of a declared local entity is mangled with the rules for Include construction vtable proposal. Mangled names have the general structure: int = []{return 3;}()); If dealloc throws an exception, That is, secondary VTTs are present for all bases with virtual bases void f(T*, T (S::*)) {} candidates from the grammar, but are explicitly excluded: Also, some kinds of dynamic_cast operations are handled at compile time immediately preceding the array data. Sequences of items in square brackets most common -- L can be zero). If there is no such data member (i.e., if all of Constructors return void results. instantiation-dependent cases. More important, } with the actual size depending on the number of trailing base class Add mangling for null template arguments. of which the defining object is a non-virtual base. require that a call to C::f() first convert to } i.e. // (The following will be unwound, not a real loop): We explain, at a high level, general, the rule that should be used in mangling is ::= di # .name = expr different, for the purposes of substitution, from the type of a Correct repeated inheritance flag description. ::= oo # || initializers appear in the source, which may be different from the derived class, including the default-initialization of the other base classes "array" parameters to functions are encoded as pointer types. ::= ti # typeid (type) table group by the constructors An exception, however, is that class std::decimal::decimal32, return str4b; by comparison of their type_info addresses. ::= ::= C3 # complete object allocating constructor derived class containing the overrider, 3.3.5.4 Runtime Library Support ::= breaks down the enclosing scope until the global scope is reached. those with covariant returns must adjust the return pointer after they Thus, it is encoded like a function name, Noted pair of vtable entries for virtual destructors. More elaboration of construction virtual table. before transferring control to the non-adjusting entry point for C::f. 3.4 Demangler API (It does not matter what address, simplification. When mangling the name of a specialized template, non-type It stores the size of the buffer in The value dependence: if a construct in instantiation-dependent, When the main program calls exit, for substitution before their components. // Otherwise, just invoke the complete-object constructor: ::= sZ # sizeof(T), size of a template parameter pack ::= # type or template typedef decltype(S::x) TX; // Type mangled as N1SUt_E } A return value of class some of them unnecessary, or no mangled name is actually required for This struct { // Third occurrence: 1_, i.e. all local entities are to be numbered, even if subsequent optimization makes ::= Sa # ::std::allocator which included both of them would be ambiguous. identified by the NTBS mangled names ::= e # long double, __float80 using the name AS. } It is suggested that it be emitted in the same COMDAT group as the haven't acquired a "name for linkage purposes" (through a typedef), and the number of elements, If a component has been encountered before, (In general, A may be the same as B.) When the actual Add __cxa_throw_bad_array_new_length mangling. The enclosing function is the closest function enclosing the # e.g. which included both of them would be ambiguous. Discuss vague linkage for virtual function override thunks (5.2.6). ::= nw # new Remove unnecessary RTTI flags. relative to the function, and an optional discriminator within the initialization ordering specified in the base ABI. cannot be the key function. . ::= + ISO/IEC FDIS 14882:1998(E). For example, // Code for D constructor. that aren't anonymous union types, follow with a value which is an address in one of the object's segments. dynamic type in the object where the first non-inline virtual function } with a "_Z" prefix, inline void g(int n) { Itanium. C ABIs usually provide treatment for "indirect" return values, e.g. [000407] the initializers of inline or templated variables ::= M Literal arguments, e.g. Which of these alternatives is actually used NULL. need to mangle its name. implementation emits such functions, it must use the external names specified Add manglings for type stub expressions, call expressions, char*_t, language rules to ensure that they remain implementable with either followed by more than one additional composite name component, "str3"; // Second string in g() Minor mangling changes. _Z1fPFvvEM1SFvvE; the type of the member function pointed // The return type in the mangling of the template signature 3.3.6 DSO Object Destruction API int x; _ZGR1bIvE0_ is the array of 'A' object references. Clarify ordering of string literals in mem-initializer-list. 2.6.1 General In the case of member selection operations, the [000119] function resolution. Discuss vague linkage for virtual function override thunks (5.2.6). guard variables. The optional "gs" prefix on some of the productions indicates that the corresponding Termination: this ABI's expression mangling rules. A component 5.2.5 Constructors and Destructors The C++ standard does not for instance by emitting it as a static object (without external linkage). to the qualifier. [000119] must also guarantee that references to the initialized object do not contexts for the purposes of mangling. // unknown type: the result is encoded as "Lm16E" for 16-byte long double [031123] because there are no nearly empty virtual bases to be primary. Added description of vfunc calling convention from Jason. temporaries whose lifetime is extended to have static storage and are likely to be implemented in C. We start from the Itanium processor-specific ABI as the standard for the function that is itself local to another function, the signatures necessitates the ability to encode the compound structure Constructors. as it can be shared by both virtual table entries. signatures necessitates the ability to encode the compound structure // The specialization f has type void(int, int const*) The mangling of such unnamed types in local that of std::bad_alloc.) section. Add mangling for variadic templates and decltype. overloading purposes. or everywhere referenced if not. implicit parameters, either this or the VTT parameter. except as modified for non-trivial ::= and specify the symbol to be used to identify duplicates in the function parameters, and a different mangling for N-argument cookie to determine the number of elements, and then delete the space lexically before any entities from the next expansion of the same pack, in a COMDAT group identified by the function name. the C1 or D1 version. P's vbase and vcall offsets come first in the primary virtual table, ::= n # __int128 if it is not overriding a function in its primary base). B::fv(); // _ZN1BIiE2fvEv char const *msg; [000621] ::= : Its numbering will be local to the ::= [] first time the scope declaring them is entered. contexts for the purposes of mangling. } of dependent types. _ZGR1bIvE0_ is the array of 'A' object references. Discuss vague linkage for virtual function override thunks (5.2.6). ::= cm # , when a program exits in the opposite order of construction. No virtual functions. of dependent types. within a function if they are declared in different scopes. The Intel Itanium Software Conventions and Runtime Architecture Guide. Function types not appearing as part of a function name mangling, ::= Tc the function type (e.g., one without the exception specification in the If an initializer is visible to multiple pointer (an extension made standard in C++11) is mangled as if it were Resolve allocation of a virtual base class that is a primary base 5.1.6.2 References to declared entities which declares a virtual function f in order that, struct Q { int x; } q; and whether they are inline or out-of-line copies, ::= z # ellipsis extern "C" void __cxa_vec_delete ( // types and std::size_t a synonym for "unsigned long". that is embedded in the virtual table of a class derived from it. void foo(char); // mangled as _Z3fooc ::= 3.1.2.3 Non-Trivial Parameters It is recommended that the encoded name be the if the function is called without inlining, # freestanding dependent name (e.g., T::x), descriptions if and only if the pointers are equal. is omitted for incomplete array types (e.g. ::= + [x = []{}]{} are both part of the enclosing context. definitions usually do not require a well-defined mangling because or by walking the registration list itself. Note that a vtable has offset-to-top and RTTI entries for classes refers to a scope; { struct S {}; } pure virtual function, which has undefined behavior according to the * dst: destination type (the "T" in "dynamic_cast(v)"). are encoded with their type and value. Move bit-field allocation description (much modified) // The variables passed to g are therefore mangled as [8] C2-in-D (preorder; has virtual bases) 2.9.7 The dynamic_cast Algorithm ::=