diff --git a/abi.html b/abi.html index b2df8ab..2a1d36b 100644 --- a/abi.html +++ b/abi.html @@ -4503,13 +4503,13 @@
-For the purposes of mangling, the name of an anonymous union is -considered to be the name of the first named data member found by a +For the purposes of mangling, the name of an anonymous struct or union +is considered to be the name of the first named data member found by a pre-order, depth-first, declaration-order walk of the data members of -the anonymous union. If there is no such data member (i.e., if all of -the data members in the union are unnamed), then there is no way for a -program to refer to the anonymous union, and there is therefore no -need to mangle its name. +the anonymous type. If there is no such data member (i.e., if all of +the data members in the struct or union are unnamed), then there is +no way for a program to refer to the anonymous type, and there is +therefore no need to mangle its name.
@@ -5499,13 +5499,188 @@
-Type arguments appear using their regular encoding.
-For example, the template class "A<char, float>" is encoded as "1AIcfE".
-A slightly more involved example is
-a dependent function parameter type "A<T2>::X"
-(T2 is the second template parameter)
-which is encoded as "N1AIT0_E1XE",
-where the "N...E" construct is used to describe a qualified name.
+Template arguments can be dependent when a template argument list
+is written in a context where dependent structures must be mangled.
+For example, if the parameter type of a function template is
+A<T2>::X, where T2 is the second
+template parameter of the function template, this is mangled as
+N1AIT0_E1XE.
+
+
+Template type arguments and template template arguments are mangled
+using their regular encoding. For example, the class template
+specialization A<char, float> is encoded as
+1AIcfE.
+
+
+A non-type template argument is considered dependent if either the
+argument expression is instantiation-dependent or it is not matched
+with a template parameter of non-dependent type. (The latter can
+happen if, for example, the template name is dependent and not a
+template parameter.) If so, it is mangled as an expression in the
+usual way for a dependent mangling.
+Otherwise, it is converted to the template parameter type,
+constant-evaluated, and then mangled as a value. For example:
+
+
+
+
+template
+Non-type template argument values of integer, enumerated,
+floating-point, or complex type are mangled as
+literals of the template parameter
+type. Note that this can produce combinations which cannot normally
+be written in the source language, such as a literal of
+short type.
+
+
+Non-type template argument values of pointer or member pointer type
+that are null are mangled as as a literal 0 of the
+template parameter type. For example:
+
+
+
+
+struct A;
+template <void (A::*)()> void f();
+
+f<nullptr> // _Z1fILM1AFvvE0EEvv
+
+Non-type template argument values of reference or pointer type
+are mangled using the subobject
+specifier expression for the argument. If this is a simple
+declaration reference, it may be mangled as an
+<expr-primary>.
+
+
+Non-type template argument values of member pointer type
+that are not null are mangled as expressions applying the
+operator & to the member function declaration
+as if it were a regular function. (Note that this does not
+distinguish between member pointers that have been converted
+to different types.) For example:
+
+
+
+
+struct A {
+ void foo();
+};
+template <void (A::*)()> void f();
+
+f<&A::foo> // _Z1fIXadL_ZN1A3fooEvEEEvv
+
+Non-type template argument values of class type are mangled as
+a direct initialization (tl) of the class type
+using the member
+initiializer sequence for the argument.
+
+
+5.1.5.11 Subobject specifier expressions
+
+
+
+Constant evaluation may result in a pointer or reference to a specific +subobject of an object of static storage duration. This subobject is +identified in the mangling as if written with a specific expression, +called its subobject specifier expression. + +
+(To be specified. See
+for now.)
+
+
+5.1.5.12 Member initializer sequences
+
+
+
+The constant evaluation of an expression of class type assigns +a constant value to each non-static data member of the class or, +if the class is a union, to at most one non-static data member, +called the active union member. Under the standard, this exact +structure uniquely determines a value, including whether a union +has an active union member member and (if so) which one. As +different values can produce different template specializations, +this structure must be faithfully represented in the mangling of +a value as a template argument. + +
+A value is converted to a flattened sequence of values by applying +the following expansions until no values of array or non-union class +type remain: +
+This sequence is then mangled as a sequence of
+<braced-expression>s
+as follows:
+
L <type > E.
+ +Note that qualifiers on the type of a non-static data member are not +part of the type of the value stored in that member. + +
+For example:
+
+
+struct A {
+ int x, y;
+};
+struct B {
+ union { A a; };
+ constexpr B(int x, int y) { a.x = x; a.y = y; }
+};
+
+template <B v> struct C {};
+
+C<0,0> // 1CIXtl1BEEE
+C<1,0> // 1CIXtl1BtlNS0_Ut_Edi1atl1ALi1EEEEEE
+C<1,1> // 1CIXtl1BtlNS0_Ut_Edi1atl1ALi1ELi1EEEEEE
+5.1.6 Expressions