Disable gcc_rich_location copying and assignment.

gcc/cp/ChangeLog:

	* parser.c (cp_parser_selection_statement): Use direct initialization
	instead of copy.

gcc/ChangeLog:

	* gcc-rich-location.h (gcc_rich_location): Make ctor explicit.

libcpp/ChangeLog:

	* include/line-map.h (class rich_location): Disable copying and
	assignment.
This commit is contained in:
Martin Sebor
2021-08-31 11:15:21 -06:00
parent e45d5b6bf1
commit e4d2305adf
3 changed files with 12 additions and 4 deletions

View File

@@ -1670,6 +1670,12 @@ class rich_location
/* 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;