IF_STMT_CONSTEVAL_P (statement) = true;
condition = finish_if_stmt_cond (boolean_false_node, statement);
- gcc_rich_location richloc = tok->location;
+ gcc_rich_location richloc (tok->location);
bool non_compound_stmt_p = false;
if (cp_lexer_next_token_is_not (parser->lexer, CPP_OPEN_BRACE))
{
RID_ELSE))
{
cp_token *else_tok = cp_lexer_peek_token (parser->lexer);
- gcc_rich_location else_richloc = else_tok->location;
+ gcc_rich_location else_richloc (else_tok->location);
guard_tinfo = get_token_indent_info (else_tok);
/* Consume the `else' keyword. */
cp_lexer_consume_token (parser->lexer);
#define GCC_RICH_LOCATION_H
/* A gcc_rich_location is libcpp's rich_location with additional
- helper methods for working with gcc's types. */
+ helper methods for working with gcc's types. The class is not
+ copyable or assignable because rich_location isn't. */
+
class gcc_rich_location : public rich_location
{
public:
/* Constructors. */
/* Constructing from a location. */
- gcc_rich_location (location_t loc, const range_label *label = NULL)
+ explicit gcc_rich_location (location_t loc, const range_label *label = NULL)
: rich_location (line_table, loc, label)
{
}
/* Destructor. */
~rich_location ();
+ /* The class manages the memory pointed to by the elements of
+ the M_FIXIT_HINTS vector and is not meant to be copied or
+ assigned. */
+ rich_location (const rich_location &) = delete;
+ void operator= (const rich_location &) = delete;
+
/* Accessors. */
location_t get_loc () const { return get_loc (0); }
location_t get_loc (unsigned int idx) const;