+2013-06-22 Gabriel Dos Reis <gdr@integrable-solutions.net>
+
+ * c-common.c (c_common_nodes_and_builtins): Use cxx11 in lieu of cxx0x.
+ * c-cppbuiltin.c (c_cpp_builtins): Likewise.
+ * c-opts.c (c_common_post_options): Likewise.
+
2013-06-21 Balaji V. Iyer <balaji.v.iyer@intel.com>
* c-common.h (struct cilkplus_an_parts): New structure.
(fix_sec_implicit_args): Likewise.
* array-notation-common.c (cilkplus_extract_an_triplets): New function.
(fix_sec_implicit_args): Likewise.
-
+
2013-06-20 Balaji V. Iyer <balaji.v.iyer@intel.com>
* array-notation-common.c (find_inv_trees): Removed an unwanted
{
char16_type_node = make_unsigned_type (char16_type_size);
- if (cxx_dialect >= cxx0x)
+ if (cxx_dialect >= cxx11)
record_builtin_type (RID_CHAR16, "char16_t", char16_type_node);
}
{
char32_type_node = make_unsigned_type (char32_type_size);
- if (cxx_dialect >= cxx0x)
+ if (cxx_dialect >= cxx11)
record_builtin_type (RID_CHAR32, "char32_t", char32_type_node);
}
cpp_define (pfile, "__DEPRECATED");
if (flag_rtti)
cpp_define (pfile, "__GXX_RTTI");
- if (cxx_dialect >= cxx0x)
+ if (cxx_dialect >= cxx11)
cpp_define (pfile, "__GXX_EXPERIMENTAL_CXX0X__");
}
/* Note that we define this for C as well, so that we know if
if (warn_implicit_function_declaration == -1)
warn_implicit_function_declaration = flag_isoc99;
- if (cxx_dialect >= cxx0x)
+ if (cxx_dialect >= cxx11)
{
/* If we're allowing C++0x constructs, don't warn about C++98
identifiers which are keywords in C++0x. */
+2013-06-22 Gabriel Dos Reis <gdr@integrable-solutions.net>
+
+ * call.c (null_ptr_cst_p): Use cxx11 in lieu of cxx0x.
+ * class.c (add_implicitly_declared_members): Likewise.
+ (check_field_decl): Likewise.
+ (finalize_literal_type_property): Likewise.
+ (check_bases_and_members): Likewise.
+ * decl.c (poplevel): Likewise.
+ (case_conversion): Likewise.
+ (check_initializer): Likewise.
+ (grokfndecl): Likewise.
+ (check_static_variable_definition): Likewise.
+ (compute_array_index_type): Likewise.
+ (grokdeclarator): Likewise.
+ (build_enumerator): Likewise.
+ * friend.c (make_friend_class): Likewise.
+ * lex.c (init_reswords): Likewise.
+ * method.c (synthesized_method_walk): Likewise.
+ (implicitly_declare_fn): Likewise.
+ * parser.c (cp_parser_diagnose_invalid_type_name): Likewise.
+ (cp_parser_constant_expression): Likewise.
+ (cp_parser_for_init_statement): Likewise.
+ (cp_parser_block_declaration): Likewise.
+ (cp_parser_type_name): Likewise.
+ (cp_parser_enum_specifier): Likewise.
+ (cp_parser_enumerator_list): Likewise.
+ (cp_parser_member_declaration): Likewise.
+ (cp_nth_tokens_can_be_std_attribute_p): Likewise.
+ (cp_parser_template_declaration_after_export): Likewise.
+ * pt.c (convert_nontype_argument_function): Likewise.
+ (convert_nontype_argument): Likewise.
+ (convert_template_argument): Likewise.
+ (tsubst_copy_and_build): Likewise.
+ (build_non_dependent_expr): Likewise.
+ * semantics.c (non_const_var_error): Likewise.
+ (potential_constant_expression_1): Likewise.
+ * tree.c (lvalue_kind): Likewise.
+ (build_vec_init_expr): Likewise.
+ (cast_valid_in_integral_constant_expression_p): Likewise.
+ * typeck.c (build_x_conditional_expr): Likewise.
+ * typeck2.c (check_narrowing): Likewise.
+
2013-06-21 Balaji V. Iyer <balaji.v.iyer@intel.com>
* call.c (convert_like_real): Added a check if array notation is present
if (CP_INTEGRAL_TYPE_P (TREE_TYPE (t)))
{
/* Core issue 903 says only literal 0 is a null pointer constant. */
- if (cxx_dialect < cxx0x)
+ if (cxx_dialect < cxx11)
t = maybe_constant_value (fold_non_dependent_expr_sfinae (t, tf_none));
STRIP_NOPS (t);
if (integer_zerop (t) && !TREE_OVERFLOW (t))
{
bool move_ok = false;
- if (cxx_dialect >= cxx0x && !CLASSTYPE_DESTRUCTORS (t)
+ if (cxx_dialect >= cxx11 && !CLASSTYPE_DESTRUCTORS (t)
&& !TYPE_HAS_COPY_CTOR (t) && !TYPE_HAS_COPY_ASSIGN (t)
&& !type_has_move_constructor (t) && !type_has_move_assign (t))
move_ok = true;
{
TYPE_HAS_DEFAULT_CONSTRUCTOR (t) = 1;
CLASSTYPE_LAZY_DEFAULT_CTOR (t) = 1;
- if (cxx_dialect >= cxx0x)
+ if (cxx_dialect >= cxx11)
TYPE_HAS_CONSTEXPR_CTOR (t)
/* This might force the declaration. */
= type_has_constexpr_default_constructor (t);
/* In C++98 an anonymous union cannot contain any fields which would change
the settings of CANT_HAVE_CONST_CTOR and friends. */
- if (ANON_UNION_TYPE_P (type) && cxx_dialect < cxx0x)
+ if (ANON_UNION_TYPE_P (type) && cxx_dialect < cxx11)
;
/* And, we don't set TYPE_HAS_CONST_COPY_CTOR, etc., for anonymous
structs. So, we recurse through their fields here. */
make it through without complaint. */
abstract_virtuals_error (field, type);
- if (TREE_CODE (t) == UNION_TYPE && cxx_dialect < cxx0x)
+ if (TREE_CODE (t) == UNION_TYPE && cxx_dialect < cxx11)
{
static bool warned;
int oldcount = errorcount;
{
tree fn;
- if (cxx_dialect < cxx0x
+ if (cxx_dialect < cxx11
|| TYPE_HAS_NONTRIVIAL_DESTRUCTOR (t))
CLASSTYPE_LITERAL_P (t) = false;
else if (CLASSTYPE_LITERAL_P (t) && !TYPE_HAS_TRIVIAL_DFLT (t)
/* Deduce noexcept on destructors. This needs to happen after we've set
triviality flags appropriately for our bases. */
- if (cxx_dialect >= cxx0x)
+ if (cxx_dialect >= cxx11)
deduce_noexcept_on_destructors (t);
/* Check all the method declarations. */
if (leaving_for_scope && VAR_P (link)
/* It's hard to make this ARM compatibility hack play nicely with
lambdas, and it really isn't necessary in C++11 mode. */
- && cxx_dialect < cxx0x
+ && cxx_dialect < cxx11
&& DECL_NAME (link))
{
tree name = DECL_NAME (link);
if (value == NULL_TREE)
return value;
- if (cxx_dialect >= cxx0x
+ if (cxx_dialect >= cxx11
&& (SCOPED_ENUM_P (type)
|| !INTEGRAL_OR_UNSCOPED_ENUMERATION_TYPE_P (TREE_TYPE (value))))
{
{
static int explained = 0;
- if (cxx_dialect < cxx0x)
+ if (cxx_dialect < cxx11)
error ("initializer invalid for static member with constructor");
else
error ("non-constant in-class initialization invalid for static "
grokclassfn (ctype, decl, flags);
/* 12.4/3 */
- if (cxx_dialect >= cxx0x
+ if (cxx_dialect >= cxx11
&& DECL_DESTRUCTOR_P (decl)
&& !TYPE_BEING_DEFINED (DECL_CONTEXT (decl))
&& !processing_template_decl)
in check_initializer. */
if (DECL_P (decl) && DECL_DECLARED_CONSTEXPR_P (decl))
return 0;
- else if (cxx_dialect >= cxx0x && !INTEGRAL_OR_ENUMERATION_TYPE_P (type))
+ else if (cxx_dialect >= cxx11 && !INTEGRAL_OR_ENUMERATION_TYPE_P (type))
{
if (!COMPLETE_TYPE_P (type))
error ("in-class initialization of static data member %q#D of "
mark_rvalue_use (size);
- if (cxx_dialect < cxx0x && TREE_CODE (size) == NOP_EXPR
+ if (cxx_dialect < cxx11 && TREE_CODE (size) == NOP_EXPR
&& TREE_SIDE_EFFECTS (size))
/* In C++98, we mark a non-constant array bound with a magic
NOP_EXPR with TREE_SIDE_EFFECTS; don't fold in that case. */;
}
else if (declarator->u.function.late_return_type)
{
- if (cxx_dialect < cxx0x)
+ if (cxx_dialect < cxx11)
/* Not using maybe_warn_cpp0x because this should
always be an error. */
error ("trailing return type only available with "
&& double_int_fits_to_tree_p (type, di))
break;
}
- if (type && cxx_dialect < cxx0x
+ if (type && cxx_dialect < cxx11
&& itk > itk_unsigned_long)
pedwarn (input_location, OPT_Wlong_long, pos ? "\
incremented enumerator value is too large for %<unsigned long%>" : "\
(possibly cv-qualified) class type, that class is declared as a
friend; otherwise, the friend declaration is ignored.
- So don't complain in C++0x mode. */
- if (cxx_dialect < cxx0x)
+ So don't complain in C++11 mode. */
+ if (cxx_dialect < cxx11)
pedwarn (input_location, complain ? 0 : OPT_Wpedantic,
"invalid type %qT declared %<friend%>", friend_type);
return;
tree id;
int mask = 0;
- if (cxx_dialect < cxx0x)
+ if (cxx_dialect < cxx11)
mask |= D_CXX0X;
if (flag_no_asm)
mask |= D_ASM | D_EXT;
bool ctor_p;
if (spec_p)
- *spec_p = (cxx_dialect >= cxx0x ? noexcept_true_spec : empty_except_spec);
+ *spec_p = (cxx_dialect >= cxx11 ? noexcept_true_spec : empty_except_spec);
if (deleted_p)
{
resolution, so a constructor can be trivial even if it would otherwise
call a non-trivial constructor. */
if (expected_trivial
- && (!copy_arg_p || cxx_dialect < cxx0x))
+ && (!copy_arg_p || cxx_dialect < cxx11))
{
if (constexpr_p && sfk == sfk_constructor)
{
if (deleted_p)
constexpr_p = false;
/* A trivial copy/move constructor is also a constexpr constructor. */
- else if (trivial_p && cxx_dialect >= cxx0x
+ else if (trivial_p && cxx_dialect >= cxx11
&& (kind == sfk_copy_constructor
|| kind == sfk_move_constructor))
gcc_assert (constexpr_p);
DECL_IN_AGGR_P (fn) = 1;
DECL_ARTIFICIAL (fn) = 1;
DECL_DEFAULTED_FN (fn) = 1;
- if (cxx_dialect >= cxx0x)
+ if (cxx_dialect >= cxx11)
{
DECL_DELETED_FN (fn) = deleted_p;
DECL_DECLARED_CONSTEXPR_P (fn) = constexpr_p;
template <typename T> struct B : public A<T> { X x; };
The user should have said "typename A<T>::X". */
- if (cxx_dialect < cxx0x && id == ridpointers[(int)RID_CONSTEXPR])
+ if (cxx_dialect < cxx11 && id == ridpointers[(int)RID_CONSTEXPR])
inform (location, "C++11 %<constexpr%> only available with "
"-std=c++11 or -std=gnu++11");
else if (processing_template_decl && current_class_type
/* We are now parsing a constant-expression. */
parser->integral_constant_expression_p = true;
parser->allow_non_integral_constant_expression_p
- = (allow_non_constant_p || cxx_dialect >= cxx0x);
+ = (allow_non_constant_p || cxx_dialect >= cxx11);
parser->non_integral_constant_expression_p = false;
/* Although the grammar says "conditional-expression", we parse an
"assignment-expression", which also permits "throw-expression"
= saved_integral_constant_expression_p;
parser->allow_non_integral_constant_expression_p
= saved_allow_non_integral_constant_expression_p;
- if (cxx_dialect >= cxx0x)
+ if (cxx_dialect >= cxx11)
{
/* Require an rvalue constant expression here; that's what our
callers expect. Reference constant expressions are handled
/* It is a range-for, consume the ':' */
cp_lexer_consume_token (parser->lexer);
is_range_for = true;
- if (cxx_dialect < cxx0x)
+ if (cxx_dialect < cxx11)
{
error_at (cp_lexer_peek_token (parser->lexer)->location,
"range-based %<for%> loops are not allowed "
cp_parser_using_directive (parser);
/* If the second token after 'using' is '=', then we have an
alias-declaration. */
- else if (cxx_dialect >= cxx0x
+ else if (cxx_dialect >= cxx11
&& token2->type == CPP_NAME
&& ((cp_lexer_peek_nth_token (parser->lexer, 3)->type == CPP_EQ)
|| (cp_nth_tokens_can_be_attribute_p (parser, 3))))
/* If it's not a class-name, keep looking. */
if (!cp_parser_parse_definitely (parser))
{
- if (cxx_dialect < cxx0x)
+ if (cxx_dialect < cxx11)
/* It must be a typedef-name or an enum-name. */
return cp_parser_nonclass_name (parser);
if (cp_lexer_next_token_is_keyword (parser->lexer, RID_CLASS)
|| cp_lexer_next_token_is_keyword (parser->lexer, RID_STRUCT))
{
- if (cxx_dialect < cxx0x)
+ if (cxx_dialect < cxx11)
maybe_warn_cpp0x (CPP0X_SCOPED_ENUMS);
/* Consume the `struct' or `class' token. */
if (!cp_parser_parse_definitely (parser))
return NULL_TREE;
- if (cxx_dialect < cxx0x)
+ if (cxx_dialect < cxx11)
maybe_warn_cpp0x (CPP0X_SCOPED_ENUMS);
has_underlying_type = true;
/* Look for the `{' but don't consume it yet. */
if (!cp_lexer_next_token_is (parser->lexer, CPP_OPEN_BRACE))
{
- if (cxx_dialect < cxx0x || (!scoped_enum_p && !underlying_type))
+ if (cxx_dialect < cxx11 || (!scoped_enum_p && !underlying_type))
{
cp_parser_error (parser, "expected %<{%>");
if (has_underlying_type)
/* If the next token is a `}', there is a trailing comma. */
if (cp_lexer_next_token_is (parser->lexer, CPP_CLOSE_BRACE))
{
- if (cxx_dialect < cxx0x && !in_system_header)
+ if (cxx_dialect < cxx11 && !in_system_header)
pedwarn (input_location, OPT_Wpedantic,
"comma at end of enumerator list");
break;
/* Check for a using-declaration. */
if (cp_lexer_next_token_is_keyword (parser->lexer, RID_USING))
{
- if (cxx_dialect < cxx0x)
+ if (cxx_dialect < cxx11)
{
/* Parse the using-declaration. */
cp_parser_using_declaration (parser,
{
/* If the `friend' keyword was present, the friend must
be introduced with a class-key. */
- if (!declares_class_or_enum && cxx_dialect < cxx0x)
+ if (!declares_class_or_enum && cxx_dialect < cxx11)
pedwarn (decl_spec_token_start->location, OPT_Wpedantic,
"in C++03 a class-key must be used "
"when declaring a friend");
initializer = cp_parser_pure_specifier (parser);
else if (decl_specifiers.storage_class != sc_static)
initializer = cp_parser_save_nsdmi (parser);
- else if (cxx_dialect >= cxx0x)
+ else if (cxx_dialect >= cxx11)
{
bool nonconst;
/* Don't require a constant rvalue in C++11, since we
#if 0
/* Enable this once a lot of code has transitioned to noexcept? */
- if (cxx_dialect >= cxx0x && !in_system_header)
+ if (cxx_dialect >= cxx11 && !in_system_header)
warning (OPT_Wdeprecated, "dynamic exception specifications are "
"deprecated in C++0x; use %<noexcept%> instead");
#endif
{
cp_token *token = cp_lexer_peek_nth_token (parser->lexer, n);
- return (cxx_dialect >= cxx0x
+ return (cxx_dialect >= cxx11
&& ((token->type == CPP_KEYWORD && token->keyword == RID_ALIGNAS)
|| (token->type == CPP_OPEN_SQUARE
&& (token = cp_lexer_peek_nth_token (parser->lexer, n + 1))
if (cp_lexer_next_token_is_keyword (parser->lexer,
RID_TEMPLATE))
cp_parser_template_declaration_after_export (parser, member_p);
- else if (cxx_dialect >= cxx0x
+ else if (cxx_dialect >= cxx11
&& cp_lexer_next_token_is_keyword (parser->lexer, RID_USING))
decl = cp_parser_alias_declaration (parser);
else
}
linkage = decl_linkage (fn_no_ptr);
- if (cxx_dialect >= cxx0x ? linkage == lk_none : linkage != lk_external)
+ if (cxx_dialect >= cxx11 ? linkage == lk_none : linkage != lk_external)
{
- if (cxx_dialect >= cxx0x)
+ if (cxx_dialect >= cxx11)
error ("%qE is not a valid template argument for type %qT "
"because %qD has no linkage",
expr, type, fn_no_ptr);
STRIP_NOPS (expr);
if (expr && (null_ptr_cst_p (expr) || TREE_CODE (expr) == PTRMEM_CST))
return true;
- if (cxx_dialect >= cxx0x && null_member_pointer_value_p (expr))
+ if (cxx_dialect >= cxx11 && null_member_pointer_value_p (expr))
return true;
if (complain & tf_error)
{
arbitrary constant expressions. Pointer and pointer to
member arguments can be general constant expressions that evaluate
to a null value, but otherwise still need to be of a specific form. */
- if (cxx_dialect >= cxx0x)
+ if (cxx_dialect >= cxx11)
{
if (TREE_CODE (expr) == PTRMEM_CST)
/* A PTRMEM_CST is already constant, and a valid template
if (DECL_P (expr) && DECL_TEMPLATE_PARM_P (expr))
/* Non-type template parameters are OK. */
;
- else if (cxx_dialect >= cxx0x && integer_zerop (expr))
+ else if (cxx_dialect >= cxx11 && integer_zerop (expr))
/* Null pointer values are OK in C++11. */;
else if (TREE_CODE (expr) != ADDR_EXPR
&& TREE_CODE (expr_type) != ARRAY_TYPE)
expr, type, decl);
return NULL_TREE;
}
- else if (cxx_dialect < cxx0x && !DECL_EXTERNAL_LINKAGE_P (decl))
+ else if (cxx_dialect < cxx11 && !DECL_EXTERNAL_LINKAGE_P (decl))
{
error ("%qE is not a valid template argument of type %qT "
"because %qD does not have external linkage",
expr, type, decl);
return NULL_TREE;
}
- else if (cxx_dialect >= cxx0x && decl_linkage (decl) == lk_none)
+ else if (cxx_dialect >= cxx11 && decl_linkage (decl) == lk_none)
{
error ("%qE is not a valid template argument of type %qT "
"because %qD has no linkage",
return error_mark_node;
}
- if (cxx_dialect >= cxx0x && integer_zerop (expr))
+ if (cxx_dialect >= cxx11 && integer_zerop (expr))
/* Null pointer values are OK in C++11. */
return perform_qualification_conversions (type, expr);
tree t = maybe_get_template_decl_from_type_decl (TYPE_NAME (arg));
if (TREE_CODE (t) == TEMPLATE_DECL)
{
- if (cxx_dialect >= cxx0x)
+ if (cxx_dialect >= cxx11)
/* OK under DR 1004. */;
else if (complain & tf_warning_or_error)
pedwarn (input_location, OPT_Wpedantic, "injected-class-name %qD"
decl = finish_id_expression (t, decl, NULL_TREE,
&idk,
integral_constant_expression_p,
- /*allow_non_integral_constant_expression_p=*/(cxx_dialect >= cxx0x),
+ /*allow_non_integral_constant_expression_p=*/(cxx_dialect >= cxx11),
&non_integral_constant_expression_p,
/*template_p=*/false,
/*done=*/true,
/* If there are no operands, it must be an expression such
as "int()". This should not happen for aggregate types
because it would form non-constant expressions. */
- gcc_assert (cxx_dialect >= cxx0x
+ gcc_assert (cxx_dialect >= cxx11
|| INTEGRAL_OR_ENUMERATION_TYPE_P (type));
return false;
#ifdef ENABLE_CHECKING
/* Try to get a constant value for all non-dependent expressions in
order to expose bugs in *_dependent_expression_p and constexpr. */
- if (cxx_dialect >= cxx0x)
+ if (cxx_dialect >= cxx11)
maybe_constant_value (fold_non_dependent_expr_sfinae (expr, tf_none));
#endif
}
else
{
- if (cxx_dialect >= cxx0x && !DECL_DECLARED_CONSTEXPR_P (r))
+ if (cxx_dialect >= cxx11 && !DECL_DECLARED_CONSTEXPR_P (r))
inform (DECL_SOURCE_LOCATION (r),
"%qD was not declared %<constexpr%>", r);
else
case STATIC_CAST_EXPR:
case REINTERPRET_CAST_EXPR:
case IMPLICIT_CONV_EXPR:
- if (cxx_dialect < cxx0x
+ if (cxx_dialect < cxx11
&& !dependent_type_p (TREE_TYPE (t))
&& !INTEGRAL_OR_ENUMERATION_TYPE_P (TREE_TYPE (t)))
/* In C++98, a conversion to non-integral type can't be part of a
/* We just return clk_ordinary for NON_DEPENDENT_EXPR in C++98, but
in C++11 lvalues don't bind to rvalue references, so we need to
work harder to avoid bogus errors (c++/44870). */
- if (cxx_dialect < cxx0x)
+ if (cxx_dialect < cxx11)
return clk_ordinary;
else
return lvalue_kind (TREE_OPERAND (ref, 0));
TREE_SIDE_EFFECTS (init) = true;
SET_EXPR_LOCATION (init, input_location);
- if (cxx_dialect >= cxx0x
+ if (cxx_dialect >= cxx11
&& potential_constant_expression (elt_init))
VEC_INIT_EXPR_IS_CONSTEXPR (init) = true;
VEC_INIT_EXPR_VALUE_INIT (init) = value_init;
cast_valid_in_integral_constant_expression_p (tree type)
{
return (INTEGRAL_OR_ENUMERATION_TYPE_P (type)
- || cxx_dialect >= cxx0x
+ || cxx_dialect >= cxx11
|| dependent_type_p (type)
|| type == error_mark_node);
}
orig_ifexp, orig_op1, orig_op2);
/* In C++11, remember that the result is an lvalue or xvalue.
In C++98, lvalue_kind can just assume lvalue in a template. */
- if (cxx_dialect >= cxx0x
+ if (cxx_dialect >= cxx11
&& lvalue_or_rvalue_with_address_p (expr)
&& !lvalue_or_rvalue_with_address_p (min))
TREE_TYPE (min) = cp_build_reference_type (TREE_TYPE (min),
if (!ok)
{
- if (cxx_dialect >= cxx0x)
+ if (cxx_dialect >= cxx11)
pedwarn (EXPR_LOC_OR_HERE (init), OPT_Wnarrowing,
"narrowing conversion of %qE from %qT to %qT inside { }",
init, ftype, type);