@@ -858,20 +858,26 @@ also included.
858858Typerefs
859859--------
860860
861- The description of a type in the intermediate language contains a type entry
862- kind ``tk_typeref ``, which is used to define typedefs, and also to add type
863- qualifiers to a type, e.g., ``const `` in ``const int ``. Such an entry is in
864- some ways not a full-fledged type. For example, it doesn't indicate its size;
865- one must go to the underlying type to get that. The macro ``skip_typerefs ``
866- and the function ``f_skip_typerefs `` can be used to strip off typerefs and get
867- to the underlying type, which can then be processed in the normal way. A very
868- common cause of bugs in code our customers add is failure to put in
869- ``skip_typerefs `` calls where necessary. (For that matter, it's a common cause
870- of bugs in our code, though we try hard to find all those bugs before we ship
871- the code.) The whole ``skip_typerefs `` issue is error-prone and requires
872- discipline, but you do get used to it, and after many years of working with it
873- we remain convinced that it's the right way to handle typedefs and type
874- qualifiers. Just be careful.
861+ The ``a_type `` IL entry can have a ``tk_typeref `` kind; such entries
862+ represent a type that is based on another type in some way. For example, a
863+ ``typedef `` is represented by a typeref entry designating the type for
864+ which it is a synonym. Similarly, cv-qualified types like ``const int `` are
865+ represented by a ``const `` typeref pointing to the entry for the ``int ``
866+ type. Additional uses for typerefs include type operators like
867+ ``decltype ``, capturing the specific template arguments used when a
868+ class or alias template specialization is referred to, and many others.
869+
870+ In general, typerefs do not have complete information about the type they
871+ represent, such as the size and alignment. As a result, it is often
872+ necessary to access the type on which a given typeref is based, and
873+ various macros and functions are provided for that operation, such as
874+ ``skip_typerefs ``, ``skip_lexical_typerefs ``,
875+ ``skip_typerefs_not_typedefs ``, etc. It is a common source of bugs to
876+ omit a call to one of these functions and operate on the typeref itself
877+ instead of its underlying type.
878+
879+ See the :ref: `il-typerefs ` section in the Intermediate Language
880+ chapter for further details.
875881
876882Source Positions
877883----------------
0 commit comments