Age | Commit message (Collapse) | Author | Files | Lines |
|
gcc/c-family/
* c-cppbuiltin.c (c_cpp_builtins): Update __cpp_constexpr for
C++17 constexpr lambdas.
gcc/cp/
* class.c (finalize_literal_type_property): Handle lambdas.
* constexpr.c (is_valid_constexpr_fn): Likewise. No longer static.
(explain_invalid_constexpr_fn, cxx_eval_call_expression): Handle
lambdas.
(cxx_eval_constant_expression): Handle capture proxy.
(var_in_constexpr_fn): Don't check for C++14.
(var_in_maybe_constexpr_fn): New.
(potential_constant_expression_1): Use it. Check DECL_EXPR for
declarations not allowed in constexpr function.
* decl.c (make_rtl_for_nonlocal_decl): Use var_in_maybe_constexpr_fn.
(finish_function): Set DECL_DECLARED_CONSTEXPR_P on lambda members.
* lambda.c (begin_lambda_type): Set CLASSTYPE_LITERAL_P.
(maybe_add_lambda_conv_op): Clear thunk CALL_EXPR location.
(lambda_static_thunk_p): New.
* parser.c (cp_keyword_starts_decl_specifier_p): Add RID_CONSTEXPR.
(CP_PARSER_FLAGS_ONLY_MUTABLE_OR_CONSTEXPR): New enumerator.
(cp_parser_decl_specifier_seq): Handle it.
(cp_parser_lambda_declarator_opt): Use cp_parser_decl_specifier_seq.
* pt.c (instantiate_class_template_1): Set CLASSTYPE_LITERAL_P.
(tsubst_copy_and_build) [CALL_EXPR]: Propagate CALL_FROM_THUNK_P.
* error.c (dump_function_decl): Check TFF_NO_TEMPLATE_BINDINGS.
(dump_expr) [FUNCTION_DECL]: Pass it.
From-SVN: r239268
|
|
PR c++/67131
* class.c (is_really_empty_class): Call complete_type.
* constexpr.c (cxx_eval_constant_expression): Check
is_really_empty_class.
(potential_constant_expression_1): Likewise. Check for error type.
From-SVN: r239267
|
|
PR c++/58706
* parser.c: Include tree-iterator.h.
(cp_parser_omp_for_loop_init): Move lambda DECL_EXPRs from init
to FOR_BLOCK.
(cp_parser_omp_for_loop): Handle non-STATEMENT_LIST FOR_BLOCK
entries.
* testsuite/libgomp.c++/pr58706.C: New test.
From-SVN: r239251
|
|
gcc/cp:
* call.c (convert_like_real): Harmonize diagnostics for invalid
reference binding.
gcc/testsuite:
* call.c (convert_like_real): Harmonize diagnostics for invalid
reference binding.
* g++.dg/conversion/pr16333.C: Adjust dg-error regexp.
* g++.dg/conversion/pr41426.C: Likewise.
* g++.dg/conversion/pr66211.C: Likewise.
* g++.dg/cpp1y/lambda-init9.C: Likewise.
* g++.dg/init/ref8.C: Likewise.
* g++.old-deja/g++.law/cvt20.C: Likewise.
* g++.old-deja/g++.mike/p9732c.C: Likewise.
From-SVN: r239184
|
|
"constant-expression" in diagnostic messages...
gcc/cp/ChangeLog:
* constexpr.c (cxx_eval_store_expression): Remove hyphen from
the spelling of "constant-expression" in diagnostic messages
for consistency.
(cxx_eval_constant_expression): Same.
(cxx_eval_outermost_constant_expr): Same.
(potential_constant_expression_1): Same.
gcc/testsuite/ChangeLog:
* g++.dg/cpp0x/constexpr-cast.C: Avoid assuming (void*)1 is spelled
1ul in diagnostics. Remove hyphen from "constant-expression."
* g++.dg/cpp0x/constexpr-50060.C: Adjust.
* g++.dg/cpp0x/static_assert3.C: Same.
* g++.dg/cpp1y/constexpr-throw.C: Same.
* g++.dg/template/nontype3.C: Same.
* g++.dg/warn/overflow-warn-1.C: Same.
* g++.dg/warn/overflow-warn-3.C: Same.
* g++.dg/warn/overflow-warn-4.C: Same.
From-SVN: r239176
|
|
PR c++/68724
* pt.c (unify): TRAIT_EXPR is an expr.
PR c++/68724
* g++.dg/cpp0x/pr68724.C: New.
From-SVN: r239167
|
|
tree check: expected class ‘type’, have ‘exceptional’ (error_mark) in add_capture, at cp/lambda.c:505)
/cp
2016-08-04 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/72800
* lambda.c (add_capture): Check lambda_capture_field_type return
value for error_mark_node.
/testsuite
2016-08-04 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/72800
* g++.dg/cpp1y/lambda-ice1.C: New.
From-SVN: r239148
|
|
gcc/cp/ChangeLog:
PR c++/72759
* pt.c (tsubst_qualified_id): Return error_mark_node if
template_args is error_mark_node.
gcc/testsuite/ChangeLog:
PR c++/72759
* g++.dg/cpp1y/pr72759.C: New test.
From-SVN: r239147
|
|
* pt.c (tsubst_pack_expansion): Pull a single pack expansion out
of the TREE_VEC.
From-SVN: r239138
|
|
* cp-tree.h (TYPE_UNNAMED_P): Rename from TYPE_ANONYMOUS_P.
(TYPE_WAS_UNNAMED): Rename from TYPE_WAS_ANONYMOUS.
* class.c, decl.c, decl2.c, error.c, lambda.c, mangle.c,
name-lookup.c, parser.c, pt.c, semantics.c, tree.c: Adjust.
From-SVN: r239137
|
|
* typeck.c (finish_class_member_access_expr): Avoid stripping
SCOPE_REF to dependent base.
From-SVN: r239136
|
|
gcc/c/
* c-parser.c (struct oacc_routine_data): Add error_seen and
fndecl_seen members.
(c_finish_oacc_routine): Use these.
(c_parser_declaration_or_fndef): Adjust.
(c_parser_oacc_routine): Likewise. Support more C language
constructs, and improve diagnostics. Move pragma context
checking...
(c_parser_pragma): ... here.
gcc/cp/
* parser.c (cp_ensure_no_oacc_routine): Improve diagnostics.
(cp_parser_late_parsing_cilk_simd_fn_info): Fix diagnostics.
(cp_parser_late_parsing_oacc_routine, cp_finalize_oacc_routine):
Simplify code, and improve diagnostics.
(cp_parser_oacc_routine): Likewise. Move pragma context
checking...
(cp_parser_pragma): ... here.
gcc/testsuite/
* c-c++-common/goacc/routine-5.c: Update.
From-SVN: r239128
|
|
gcc/c/
* c-parser.c (struct oacc_routine_data): New.
(c_parser_declaration_or_fndef, c_parser_oacc_routine): Use it.
Simplify code.
(c_finish_oacc_routine): Likewise. Don't attach clauses to "omp
declare target" attribute.
gcc/cp/
* parser.h (struct cp_omp_declare_simd_data): New.
(struct cp_parser): Use it for oacc_routine member.
* parser.c (cp_ensure_no_oacc_routine, cp_parser_oacc_routine)
(cp_parser_late_parsing_oacc_routine, cp_finalize_oacc_routine):
Use it. Simplify code.
(cp_parser_new): Initialize all members pointing to special
parsing data structures.
(cp_parser_cilk_simd_fn_vector_attrs): Initialize
parser->cilk_simd_fn_info->clauses.
(cp_parser_omp_declare_simd): Initialize
parser->omp_declare_simd->clauses.
(cp_parser_late_parsing_omp_declare_simd): Simplify code.
From-SVN: r239127
|
|
PR c++/70229
* constexpr.c (check_constexpr_ctor_body_1): Allow typedef
declarations.
* g++.dg/cpp0x/constexpr-ctor19.C: New test.
From-SVN: r239115
|
|
* mangle.c (mangle_decl): Warn about mangled name change even if
DECL_REALLY_EXTERN.
From-SVN: r238966
|
|
* mangle.c (get_abi_tags): New.
(find_substitution, write_unqualified_name, write_abi_tags)
(maybe_check_abi_tags): Use it.
From-SVN: r238965
|
|
From-SVN: r238964
|
|
* constexpr.c (cxx_eval_pointer_plus_expression): Check constancy
of nelts.
* cp-gimplify.c (cp_fully_fold): Only maybe_constant_value in
C++11 and up.
From-SVN: r238957
|
|
PR c++/60760 - arithmetic on null pointers should not be allowed in constant
PR c++/71091 - constexpr reference bound to a null pointer dereference
gcc/cp/ChangeLog:
PR c++/60760
PR c++/71091
* constexpr.c (cxx_eval_binary_expression): Reject invalid expressions
involving null pointers.
(cxx_eval_component_reference): Reject null pointer dereferences.
(cxx_eval_indirect_ref): Reject indirecting through null pointers.
(cxx_eval_constant_expression): Reject invalid expressions involving
null pointers.
gcc/testsuite/ChangeLog:
PR c++/60760
PR c++/71091
* g++.dg/cpp0x/constexpr-cast.C: New test.
* g++.dg/cpp0x/constexpr-nullptr-2.C: New test.
* g++.dg/cpp1y/constexpr-sfinae.C: Correct.
* g++.dg/ubsan/pr63956.C: Correct.
From-SVN: r238909
|
|
PR c/71926
* c-common.c (c_common_truthvalue_conversion): Use LOCATION for the
parentheses warning.
* semantics.c (maybe_convert_cond): Use the location of COND for the
parentheses warning.
* g++.dg/warn/Wparentheses-30.C: New test.
* gcc.dg/Wparentheses-14.c: New test.
From-SVN: r238886
|
|
From-SVN: r238873
|
|
* init.c (expand_aggr_init_1): Only handle value-init of bases.
* constexpr.c (build_data_member_initialization): Handle multiple
initializers for the same field.
From-SVN: r238867
|
|
enumerator value: in cxx_eval_constant_expression, at cp/constexpr.c:3918)
/cp
2016-07-28 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/71665
* decl.c (build_enumerator): Check the type of the enumerator before
calling cxx_constant_value.
/testsuite
2016-07-28 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/71665
* g++.dg/cpp0x/pr71665-1.C: New.
* g++.dg/cpp0x/pr71665-2.C: Likewise.
* g++.dg/cpp0x/enum29.C: Adjust dg-error string.
* g++.dg/ext/label10.C: Likewise.
* g++.dg/parse/constant5.C: Likewise.
From-SVN: r238828
|
|
* pt.c (get_partial_spec_bindings): Replace tparms and spec_args
parameters with spec_tmpl. Call push_tinst_level.
(most_specialized_partial_spec): Adjust.
(more_specialized_partial_spec): Adjust.
From-SVN: r238785
|
|
* cp-gimplify.c (genericize_cp_loop): Revert location change.
From-SVN: r238737
|
|
* lambda.c (add_capture): Leave a pack expansion in a TREE_LIST.
(build_lambda_object): Call build_x_compound_expr_from_list.
* pt.c (tsubst) [DECLTYPE_TYPE]: Likewise.
From-SVN: r238733
|
|
PR c++/54440
* pt.c (coerce_template_parameter_pack): Fix logic for
pack index.
From-SVN: r238731
|
|
gcc/c-family/
* c.opt (fconstexpr-loop-limit): New.
gcc/cp/
* constexpr.c (cxx_eval_loop_expr): Count iterations.
* cp-gimplify.c (genericize_cp_loop): Use start_locus even for
infinite loops.
From-SVN: r238730
|
|
* constexpr.c (cxx_eval_array_reference): Handle looking for the
value of an element we're currently modifying.
From-SVN: r238729
|
|
* pt.c (resolve_typename_type): Try to avoid calling
currently_open_class.
From-SVN: r238696
|
|
* call.c (add_list_candidates): Handle VTT parm.
(build_new_method_call_1): Likewise.
From-SVN: r238689
|
|
PR c++/63151
* init.c (expand_aggr_init_1): Handle list-initialization from {}.
From-SVN: r238688
|
|
* class.c (walk_subobject_offsets): Handle 0-length array.
From-SVN: r238687
|
|
* pt.c (tsubst): Also substitute into the template of a
BOUND_TEMPLATE_TEMPLATE_PARM.
From-SVN: r238686
|
|
* pt.c (lookup_template_class_1): Handle getting template from tsubst.
From-SVN: r238685
|
|
* decl.c (reshape_init_r): Check complain for missing braces warning.
From-SVN: r238684
|
|
* call.c (convert_like_real): Use lvalue_kind.
From-SVN: r238683
|
|
PR c++/52746
* pt.c (tsubst_baselink): Call
adjust_result_of_qualified_name_lookup for unqualified
destructors.
From-SVN: r238681
|
|
* semantics.c (apply_deduced_return_type): Call
complete_type_or_else before building the new RESULT_DECL.
From-SVN: r238624
|
|
* decl2.c (maybe_instantiate_decl): Split out from mark_used.
(decl_constant_var_p): Use it instead.
From-SVN: r238623
|
|
* pt.c (instantiate_decl): Fix pattern_defined for namespace scope
variable templates.
From-SVN: r238622
|
|
* call.c (unsafe_copy_elision_p): It's OK to elide when
initializing an unknown object.
From-SVN: r238621
|
|
constructors.
* call.c (build_over_call): Check unsafe_copy_elision_p even for
trivial constructors.
* method.c (do_build_copy_constructor): Don't copy tail padding
even in a trivial constructor.
From-SVN: r238620
|
|
PR c++/71728
* constexpr.c (potential_constant_expression_1) <case GOTO_EXPR>:
Replace assert with test, return false if the goto isn't break
or continue. Formatting fix.
* g++.dg/other/pr71728.C: New test.
From-SVN: r238601
|
|
DECL_INITIAL.
2016-07-21 Richard Biener <rguenther@suse.de>
* function-tests.c (build_trivial_generic_function): Set
BLOCK_SUPERCONTEXT of DECL_INITIAL.
* omp-low.c (create_omp_child_function): Likewise.
(grid_expand_target_grid_body): Likewise.
* cgraphunit.c (init_lowered_empty_function): Likewise.
(cgraph_node::expand_thunk): Likewise.
* tree-parloops.c (create_loop_fn): Likewise.
* ipa.c (cgraph_build_static_cdtor_1): Likewise.
cp/
* vtable-class-hierarchy.c (vtv_generate_init_routine): Set
DECL_IGNORED_P.
java/
* jcf-parse.c (java_emit_static_constructor): Set
BLOCK_SUPERCONTEXT of DECL_INITIAL.
From-SVN: r238589
|
|
PR c++/71941
* cp-gimplify.c (cp_genericize): For nested cp_genericize calls
save/restore bc_label array.
* g++.dg/gomp/pr71941.C: New test.
From-SVN: r238579
|
|
* parser.c (cp_parser_lambda_expression): Unset OK if there was an
error parsing the lambda-declarator.
From-SVN: r238563
|
|
* constexpr.c (cxx_eval_binary_expression): Handle comparison
between lowered and unlowered PTRMEM_CST.
From-SVN: r238562
|
|
gcc/c-family/
* c-common.c (c_common_truthvalue_conversion): Check
c_inhibit_evaluation_warnings for warning about address of
reference.
gcc/cp/
* typeck.c (cp_truthvalue_conversion): Compare pointers to nullptr.
Don't set c_inhibit_evaluation_warnings.
From-SVN: r238560
|
|
* cp-gimplify.c (cp_fully_fold): First call maybe_constant_value.
From-SVN: r238559
|