GCC Middle and Back End API Reference
range_label_for_type_mismatch Class Reference

#include <gcc-rich-location.h>

Inheritance diagram for range_label_for_type_mismatch:
Collaboration diagram for range_label_for_type_mismatch:

Public Member Functions

 range_label_for_type_mismatch (tree labelled_type, tree other_type)
 
label_text get_text (unsigned range_idx) const override
 

Protected Attributes

tree m_labelled_type
 
tree m_other_type
 

Detailed Description

Concrete subclass of libcpp's range_label for use in
diagnostics involving mismatched types.

Each frontend that uses this should supply its own implementation.

Generate a label describing LABELLED_TYPE.  The frontend may use
OTHER_TYPE where appropriate for highlighting the differences between
the two types (analogous to C++'s use of %H and %I with
template types).

Either or both of LABELLED_TYPE and OTHER_TYPE may be NULL_TREE.
If LABELLED_TYPE is NULL_TREE, then there is no label.

For example, this rich_location could use two instances of
range_label_for_type_mismatch:

   printf ("arg0: %i  arg1: %s arg2: %i",
                            ^~
                            |
                            const char *
           100, 101, 102);
                ~~~
                |
                int

(a) the label for "%s" with LABELLED_TYPE for "const char*" and
(b) the label for "101" with LABELLED TYPE for "int"
where each one uses the other's type as OTHER_TYPE.   

Constructor & Destructor Documentation

◆ range_label_for_type_mismatch()

range_label_for_type_mismatch::range_label_for_type_mismatch ( tree labelled_type,
tree other_type )
inline

Member Function Documentation

◆ get_text()

label_text range_label_for_type_mismatch::get_text ( unsigned range_idx) const
override

Field Documentation

◆ m_labelled_type

tree range_label_for_type_mismatch::m_labelled_type
protected

◆ m_other_type

tree range_label_for_type_mismatch::m_other_type
protected

The documentation for this class was generated from the following file: