aboutsummaryrefslogtreecommitdiff
path: root/gcc/c/c-objc-common.cc
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/c/c-objc-common.cc')
-rw-r--r--gcc/c/c-objc-common.cc8
1 files changed, 6 insertions, 2 deletions
diff --git a/gcc/c/c-objc-common.cc b/gcc/c/c-objc-common.cc
index 7e227d3..d574bc7 100644
--- a/gcc/c/c-objc-common.cc
+++ b/gcc/c/c-objc-common.cc
@@ -32,7 +32,6 @@ along with GCC; see the file COPYING3. If not see
#include "stringpool.h"
#include "attribs.h"
#include "dwarf2.h"
-#include "make-unique.h"
static bool c_tree_printer (pretty_printer *, text_info *, const char *,
int, bool, bool, bool, bool *, pp_token_list &);
@@ -217,6 +216,11 @@ get_aka_type (tree type)
return canonical ? canonical : type;
}
}
+ /* For tagged types ignore attributes because they will otherwise
+ be ignored later causing a warning inside diagnostics which leads
+ to an ICE. */
+ if (RECORD_OR_UNION_TYPE_P (type) || TREE_CODE (type) == ENUMERAL_TYPE)
+ return build_qualified_type (result, TYPE_QUALS (type));
return build_type_attribute_qual_variant (result, TYPE_ATTRIBUTES (type),
TYPE_QUALS (type));
}
@@ -412,7 +416,7 @@ has_c_linkage (const_tree decl ATTRIBUTE_UNUSED)
void
c_initialize_diagnostics (diagnostic_context *context)
{
- context->set_pretty_printer (::make_unique<c_pretty_printer> ());
+ context->set_pretty_printer (std::make_unique<c_pretty_printer> ());
c_common_diagnostics_set_defaults (context);
context->set_format_decoder (&c_tree_printer);
}