#include "coretypes.h"
#include "tm.h"
#include "tree.h"
+#include "stringpool.h"
+#include "stor-layout.h"
+#include "varasm.h"
+#include "attribs.h"
+#include "calls.h"
#include "flags.h"
#include "cp-tree.h"
#include "tree-iterator.h"
if (! DECL_TEMPLATE_SPECIALIZATION (old_decl)
&& DECL_TEMPLATE_SPECIALIZATION (new_decl))
return true;
+
+ error ("redeclaration %qD differs in %<constexpr%>", new_decl);
+ error ("from previous declaration %q+D", old_decl);
+ return false;
}
- error ("redeclaration %qD differs in %<constexpr%>", new_decl);
- error ("from previous declaration %q+D", old_decl);
- return false;
+ return true;
}
#define GNU_INLINE_P(fn) (DECL_DECLARED_INLINE_P (fn) \
if (TREE_CODE (ce->index) == INTEGER_CST)
{
/* A C99 designator is OK if it matches the current index. */
- if (tree_fits_uhwi_p (ce->index)
- && tree_to_uhwi (ce->index) == index)
+ if (wi::eq_p (ce->index, index))
return true;
else
sorry ("non-trivial designated initializers not supported");
&& !(init && BRACE_ENCLOSED_INITIALIZER_P (init)
&& CP_AGGREGATE_TYPE_P (type)
&& (CLASS_TYPE_P (type)
+ || !TYPE_NEEDS_CONSTRUCTING (type)
|| type_has_extended_temps (type))))
{
init_code = build_aggr_init_full_exprs (decl, init, flags);
{
error ("size of array %qs is too large", name);
/* If we proceed with the array type as it is, we'll eventually
- crash in tree_to_uhwi (). */
+ crash in tree_to_[su]hwi(). */
type = error_mark_node;
}
if (type_uses_auto (type))
{
- if (template_parm_flag)
- {
- error ("template parameter declared %<auto%>");
- type = error_mark_node;
- }
- else if (decl_context == CATCHPARM)
- {
- error ("catch parameter declared %<auto%>");
- type = error_mark_node;
- }
- else if (current_class_type && LAMBDA_TYPE_P (current_class_type))
- {
- if (cxx_dialect < cxx1y)
- pedwarn (location_of (type), 0,
- "use of %<auto%> in lambda parameter declaration "
- "only available with "
- "-std=c++1y or -std=gnu++1y");
- }
- else if (cxx_dialect < cxx1y)
- pedwarn (location_of (type), 0,
- "use of %<auto%> in parameter declaration "
- "only available with "
- "-std=c++1y or -std=gnu++1y");
+ if (cxx_dialect >= cxx1y)
+ error ("%<auto%> parameter not permitted in this context");
else
- pedwarn (location_of (type), OPT_Wpedantic,
- "ISO C++ forbids use of %<auto%> in parameter "
- "declaration");
+ error ("parameter declared %<auto%>");
+ type = error_mark_node;
}
/* A parameter declared as an array of T is really a pointer to T.