1 2015-04-14 David Krauss <david_work@me.com>
4 * decl.c (grokdeclarator): Do not flag friends with deduced return.
6 2015-04-14 Momchil Velikov <momchil.velikov@gmail.com>
7 Jason Merrill <jason@redhat.com>
10 * parser.c (cp_parser_class_name): Add enum_ok parameter.
11 (cp_parser_qualifying_entity): Use it instead of cp_parser_type_name.
12 (cp_parser_diagnose_invalid_type_name): Don't assume a template is
15 2015-04-12 Jakub Jelinek <jakub@redhat.com>
18 * constexpr.c (cxx_eval_pointer_plus_expression): Don't fold for VLAs,
19 don't fold if op01 isn't divisible by TYPE_SIZE_UNIT. Convert
20 the expression to the original type at the end.
22 2015-04-09 Jakub Jelinek <jakub@redhat.com>
25 * tree.c (cp_build_qualified_type_real): Copy TYPE_ALIGN and
29 * tree.c (build_cplus_array_type): Layout type before variants are
30 set, but copy over TYPE_SIZE and TYPE_SIZE_UNIT from the main
33 2015-04-03 Paolo Carlini <paolo.carlini@oracle.com>
36 * lambda.c (add_capture): Use dependent_type_p for capture by
39 2015-04-02 Marek Polacek <polacek@redhat.com>
42 * constexpr.c (cxx_eval_pointer_plus_expression): Call
43 cxx_eval_constant_expression on the first operand.
45 2015-04-01 Jason Merrill <jason@redhat.com>
48 * decl.c (make_typename_type): Handle seeing a variable template.
50 2015-04-01 Paolo Carlini <paolo.carlini@oracle.com>
53 * pt.c (instantiating_current_function_p): New.
54 * name-lookup.c (pushdecl_maybe_friend_1): Use it.
55 * cp-tree.h (instantiating_current_function_p): Declare.
57 2015-04-01 Jason Merrill <jason@redhat.com>
60 * decl.c (grokvardecl): Don't call check_explicit_specialization
61 for non-template members of a class template.
63 2015-04-01 Marek Polacek <polacek@redhat.com>
66 * class.c (finish_struct): Require that the second field of a
67 user-defined initializer_list be of size type.
69 2015-03-31 Marek Polacek <polacek@redhat.com>
72 * tree.c (build_cplus_array_type): Use dependent_type_p rather than
73 checking for constness.
75 2015-03-30 Marek Polacek <polacek@redhat.com>
78 * constexpr.c (cxx_fold_indirect_ref): Don't perform the
79 *(&A[i] p+ j) => A[i + j] transformation here.
80 (cxx_eval_pointer_plus_expression): New function.
81 (cxx_eval_constant_expression): Use it here.
83 2015-03-27 Tobias Burnus <burnus@net-b.de>
86 * parser.c (cp_parser_omp_for, cp_parser_omp_parallel,
87 cp_parser_omp_distribute, cp_parser_omp_teams, cp_parser_omp_target,
88 cp_parser_omp_declare): Don't show error for skipped omp pragmas with
91 2015-03-27 Marek Polacek <polacek@redhat.com>
94 * semantics.c (finish_switch_cond): If the unlowered type is not an
95 enum, use the type of the condition.
97 2015-03-27 Jason Merrill <jason@redhat.com>
100 * decl.c (make_rtl_for_nonlocal_decl): Don't defer static
103 2015-03-26 Mikhail Maltsev <maltsevm@gmail.com>
106 * init.c (build_vec_init): Fix initializing aggregates
107 with empty init list.
109 2015-03-26 Jason Merrill <jason@redhat.com>
112 * constexpr.c (potential_constant_expression_1): Handle MEM_REF.
114 2015-03-25 Marek Polacek <polacek@redhat.com>
117 * name-lookup.c (handle_namespace_attrs): Ignore abi_tag attribute
118 on an anonymous namespace.
120 2015-03-25 Marek Polacek <polacek@redhat.com>
123 * class.c (remove_zero_width_bit_fields): Check for null DECL_SIZE.
125 2015-03-24 Jason Merrill <jason@redhat.com>
128 * cp-tree.h (NAMESPACE_IS_INLINE): Remove.
129 * parser.c (cp_parser_namespace_definition): Don't set it.
130 * name-lookup.c (handle_namespace_attrs): Check
131 DECL_NAMESPACE_ASSOCIATIONS instead.
134 * pt.c (get_mostly_instantiated_function_type): Just return the
135 type of the partially instantiated template in DECL_TI_TEMPLATE.
137 2015-03-20 Marek Polacek <polacek@redhat.com>
140 * constexpr.c (cxx_fold_indirect_ref): Transform *(&A[i] p+ j) into
143 2015-03-20 Marek Polacek <polacek@redhat.com>
146 * typeck.c (lookup_anon_field): Make sure we're dealing with the main
149 2015-03-19 Jason Merrill <jason@redhat.com>
152 Automatically propagate ABI tags to variables and functions
153 from their (return) type.
154 * class.c (check_tag): Handle variables and functions.
155 (mark_or_check_attr_tags): Split out from find_abi_tags_r.
156 (mark_or_check_tags): Likewise.
157 (mark_abi_tags): Use it. Rename from mark_type_abi_tags.
158 (check_abi_tags): Add single argument overload for decls.
159 Handle inheriting tags for decls.
160 * mangle.c (write_mangled_name): Call it.
161 (mangle_return_type_p): Split out from write_encoding.
162 (unmangled_name_p): Split out from write_mangled_name.
163 (write_mangled_name): Ignore abi_tag on namespace.
164 * cp-tree.h (NAMESPACE_IS_INLINE): Replace NAMESPACE_ABI_TAG.
165 * parser.c (cp_parser_namespace_definition): Set it.
166 * name-lookup.c (handle_namespace_attrs): Use arguments. Warn
167 about abi_tag attribute on non-inline namespace.
168 * tree.c (check_abi_tag_args): Split out from handle_abi_tag_attribute.
169 (handle_abi_tag_attribute): Allow tags on variables.
171 2015-03-19 Jakub Jelinek <jakub@redhat.com>
173 * decl2.c (cplus_decl_attributes): Also add "omp declare target"
174 attribute for DECL_EXTERNAL VAR_DECLs.
176 2015-03-18 Paolo Carlini <paolo.carlini@oracle.com>
179 * call.c (build_over_call): Pass the tsubst_flags_t argument to
181 * decl2.c (mark_used): Inline the require_deduced_type call and
182 guard the error call.
184 2015-03-16 Jason Merrill <jason@redhat.com>
187 * parser.c (cp_parser_template_name): Call strip_using_decl.
189 2015-03-16 Marek Polacek <polacek@redhat.com>
193 * decl.c (grokdeclarator): Allow volatile and constexpr together.
195 2015-03-12 Paolo Carlini <paolo.carlini@oracle.com>
198 * decl.c (check_default_argument): Don't call
199 maybe_warn_zero_as_null_pointer_constant.
201 2015-03-11 Aldy Hernandez <aldyh@redhat.com>
203 * cp-gimplify.c (simple_empty_class_p): New.
204 * cp-gimplify.c (cp_gimplify_expr): Handle RETURN_EXPR. Abstract
205 the code for empty class copies into simple_empty_class_p, and
206 adapt it to handle COMPOUND_EXPRs.
208 2015-03-10 Paolo Carlini <paolo.carlini@oracle.com>
211 * decl.c (duplicate_decls): Call check_redeclaration_no_default_args
212 only if the location of newdecl doesn't match the location of olddecl.
214 2015-03-10 Jakub Jelinek <jakub@redhat.com>
217 * parser.c (parsing_nsdmi): Don't return true if current_class_ptr
220 2015-03-10 Jason Merrill <jason@redhat.com>
224 * pt.c (dependent_type_p_r): Check both class and alias template args.
226 2015-03-10 Jakub Jelinek <jakub@redhat.com>
229 * parser.c (cp_parser_binary_expression): Check for tcc_comparison
230 before preparing arguments to warn_logical_not_parentheses.
231 Use maybe_constant_value on rhs.
233 2015-03-09 Jason Merrill <jason@redhat.com>
236 * call.c: Don't call maybe_resolve_dummy when calling a constructor.
238 2015-03-09 Jakub Jelinek <jakub@redhat.com>
241 * parser.c (cp_parser_binary_expression): Don't warn for
242 !!x == y or !b == y where b is bool.
244 2015-03-06 Aldy Hernandez <aldyh@redhat.com>
246 * ptree.c (cxx_print_lambda_node): New.
247 (cxx_print_xnode): Handle LAMBDA_EXPR.
249 2015-03-03 Aldy Hernandez <aldyh@redhat.com>
252 * constexpr.c (cxx_eval_constant_expression): Remove assert in
253 RESULT_DECL handling.
255 2015-02-26 Marek Polacek <polacek@redhat.com>
258 * constexpr.c (cxx_eval_constant_expression): Don't evaluate
259 a RETURN_EXPR if its operand is null.
261 2015-02-25 Jason Merrill <jason@redhat.com>
264 * decl2.c (constrain_visibility) [VISIBILITY_ANON]: Clear
266 (constrain_visibility_for_template): Handle reference arguments.
269 * decl.c (start_preparsed_function): Use create_artificial_label
272 2015-02-17 Paolo Carlini <paolo.carlini@oracle.com>
273 Jakub Jelinek <jakub@redhat.com>
276 * constexpr.c (check_constexpr_bind_expr_vars): Allow
277 implicit typedefs for lambda types.
279 2015-02-13 Paolo Carlini <paolo.carlini@oracle.com>
282 * decl.c (lookup_and_check_tag): Use strip_using_decl.
284 2015-02-13 Jason Merrill <jason@redhat.com>
287 * pt.c (template_args_equal): Look through conversions here.
288 * tree.c (cp_tree_equal): Not here.
290 2015-02-13 Paolo Carlini <paolo.carlini@oracle.com>
293 * parser.c (cp_parser_pragma): Diagnose PRAGMA_IVDEP at
294 pragma_external context.
296 2015-02-13 Jason Merrill <jason@redhat.com>
299 * call.c (reference_binding): Don't look for bad conversion
302 2015-02-13 Paolo Carlini <paolo.carlini@oracle.com>
305 * decl.c (make_typename_type): Pass tsubst_flags_t argument
306 to lookup_template_class.
308 2015-02-13 Jakub Jelinek <jakub@redhat.com>
311 * decl.c (start_preparsed_function): Use void_type_node instead
312 of NULL_TREE as LABEL_DECL type.
314 2015-02-12 Jason Merrill <jason@redhat.com>
317 * mangle.c (write_mangled_name): Fix test for variable template
320 * decl.c (begin_destructor_body): Condition clobber on
323 2015-02-12 Andrea Azzarone <azzaronea@gmail.com>
326 * parser.c (lookup_literal_operator): Return all candidates.
327 (cp_parser_userdef_char_literal): Simplify error handling.
328 (cp_parser_userdef_numeric_literal): Pass tf_warning_or_error.
329 (cp_parser_userdef_string_literal): Pass tf_warning_or_error.
330 Also give higher priority to standard string UDL operator.
332 2015-02-12 Jakub Jelinek <jakub@redhat.com>
335 * cp-tree.h (BLOCK_OUTER_CURLY_BRACE_P): Define.
336 * decl.c (poplevel): If functionbody, try not to create an extra
337 BLOCK for function body and use subblocks as that, if it is non-NULL
338 and doesn't have siblings. Set BLOCK_OUTER_CURLY_BRACE_P flag.
339 (outer_curly_brace_block): Use BLOCK_OUTER_CURLY_BRACE_P flag.
342 * except.c (check_noexcept_r): Return NULL for internal
345 2015-02-10 Jason Merrill <jason@redhat.com>
348 * constexpr.c (cxx_eval_call_expression): Walk the clone list.
350 2015-02-10 Jan Hubicka <hubicka@ucw.cz>
353 * method.c (use_thunk): Do not check for stdarg thunks.
355 2015-02-06 Jason Merrill <jason@redhat.com>
358 * init.c (build_vec_init): Handle default-initialized array with
359 constexpr default constructor.
361 2015-02-04 Jakub Jelinek <jakub@redhat.com>
365 * parser.c (cp_parser_omp_atomic): Handle RDIV_EXPR.
367 2015-02-03 Paolo Carlini <paolo.carlini@oracle.com>
370 * typeck.c (cp_build_binary_op): Avoid spurious -Waddress warnings
371 for generated expressions.
373 2015-02-02 Ville Voutilainen <ville.voutilainen@gmail.com>
376 * decl.c (duplicate_decls): Also duplicate DECL_FINAL_P and
379 2015-02-02 Jason Merrill <jason@redhat.com>
381 * tree.c (handle_abi_tag_attribute): Diagnose invalid arguments.
383 2015-01-30 Joseph Myers <joseph@codesourcery.com>
385 * class.c, except.c, parser.c, pt.c: All callers of fatal_error
386 changed to pass input_location as first argument.
388 2015-01-29 Jakub Jelinek <jakub@redhat.com>
391 * cp-ubsan.c (cp_ubsan_instrument_vptr): Don't wrap vptr
394 2015-01-29 Jason Merrill <jason@redhat.com>
397 * semantics.c (finish_return_stmt): Suppress -Wreturn-type on
398 erroneous return statement.
401 * repo.c (repo_emit_p): It's OK for a clone to be extern at this
404 2015-01-27 Caroline Tice <cmtice@google.com>
406 Committing VTV Cywin/Ming patch for Patrick Wollgast
407 * vtable-class-hierarchy.cc (vtv_generate_init_routine): Add
408 check for not TARGET_PECOFF at the VTV_PREINIT_PRIORITY checks.
410 2015-01-27 Jason Merrill <jason@redhat.com>
413 * lambda.c (maybe_add_lambda_conv_op): Check cfun rather than
414 current_function_decl.
417 * pt.c (finish_template_variable): Move from semantics.c.
418 Handle multiple template arg levels. Handle coercion here.
419 (lookup_template_variable): Not here.
421 2015-01-23 Jason Merrill <jason@redhat.com>
425 * typeck2.c (split_nonconstant_init_1): Remove a sub-CONSTRUCTOR
426 that has been completely split out.
429 * constexpr.c (cxx_eval_constant_expression): Don't crash on C++
433 * constexpr.c (cxx_eval_constant_expression): Allow for lvalue use
436 2015-01-21 Jason Merrill <jason@redhat.com>
439 * constexpr.c (cxx_eval_constant_expression): Only shortcut
440 constant CONSTRUCTORs.
443 * constexpr.c (ensure_literal_type_for_constexpr_object): Don't
444 give a hard error in a template instantiation.
446 2015-01-21 Richard Biener <rguenther@suse.de>
449 * decl.c (duplicate_decls): Call set_builtin_decl_declared_p
450 for builtins the user declared correctly.
452 2015-01-16 Paolo Carlini <paolo.carlini@oracle.com>
455 * pt.c (unify): When BRACE_ENCLOSED_INITIALIZER_P (arg), handle
456 TREE_TYPE (elt) == error_mark_node.
458 2015-01-15 Jan Hubicka <hubicka@ucw.cz>
460 PR tree-optimization/62053
461 * tree.c (build_cplus_array_type): Layout type after variants are set.
463 2015-01-15 Jakub Jelinek <jakub@redhat.com>
465 * cp-gimplify.c (cp_genericize_r): Call
466 cp_ubsan_maybe_instrument_member_call for member calls.
467 (cp_ubsan_check_member_access_r): New function.
468 (cp_genericize_tree): Call cp_ubsan_instrument_member_accesses.
469 * cp-tree.h (cp_ubsan_maybe_instrument_member_call,
470 cp_ubsan_instrument_member_accesses,
471 cp_ubsan_maybe_instrument_downcast,
472 cp_ubsan_maybe_instrument_cast_to_vbase): New prototypes.
473 * cp-ubsan.c: New file.
474 * Make-lang.in (CXX_AND_OBJCXX_OBJS): Add cp/cp-ubsan.o.
475 * constexpr.c (cxx_eval_call_expression): Return void_node
477 (potential_constant_expression_1): Return true for
478 UBSAN_NULL, UBSAN_BOUNDS and UBSAN_VPTR internal calls.
479 * typeck.c (build_class_member_access_expr): Provide locus
481 (build_static_cast_1): Instrument downcasts.
482 * class.c (build_base_path): For -fsanitize=vptr and !fixed_type_p
483 add ubsan instrumentation for virtual_access.
484 * call.c: Include internal-fn.h.
485 (set_flags_from_callee): Handle internal calls.
487 2015-01-15 Momchil Velikov <momchil.velikov@gmail.com>
490 * name-lookup.c (pushdecl_maybe_friend_1): Hide friend functions
491 and function templates, declared only in the class.
492 * decl.c (duplicate_decls): Reveal hidden friend functions or
493 function templates, if they are redeclared outside the class.
495 2015-01-15 Jason Merrill <jason@redhat.com>
498 * constexpr.c (cxx_eval_binary_expression): Fix pasto.
501 * constexpr.c (potential_constant_expression_1): Handle reference
504 2015-01-15 Thomas Schwinge <thomas@codesourcery.com>
505 James Norris <jnorris@codesourcery.com>
506 Cesar Philippidis <cesar@codesourcery.com>
507 Ilmir Usmanov <i.usmanov@samsung.com>
508 Jakub Jelinek <jakub@redhat.com>
510 * parser.c: Include "gomp-constants.h".
511 (cp_parser_omp_clause_map): Use enum gomp_map_kind instead of enum
512 omp_clause_map_kind. Use GOMP_MAP_* instead of OMP_CLAUSE_MAP_*.
513 Use OMP_CLAUSE_SET_MAP_KIND.
514 (cp_parser_omp_construct, cp_parser_pragma): Handle
515 PRAGMA_OACC_CACHE, PRAGMA_OACC_DATA, PRAGMA_OACC_ENTER_DATA,
516 PRAGMA_OACC_EXIT_DATA, PRAGMA_OACC_KERNELS, PRAGMA_OACC_PARALLEL,
517 PRAGMA_OACC_LOOP, PRAGMA_OACC_UPDATE, PRAGMA_OACC_WAIT.
518 (cp_parser_omp_clause_name): Handle "async", "copy", "copyout",
519 "create", "delete", "deviceptr", "host", "num_gangs",
520 "num_workers", "present", "present_or_copy", "pcopy",
521 "present_or_copyin", "pcopyin", "present_or_copyout", "pcopyout",
522 "present_or_create", "pcreate", "vector_length", "wait".
523 (OACC_DATA_CLAUSE_MASK, OACC_ENTER_DATA_CLAUSE_MASK)
524 (OACC_EXIT_DATA_CLAUSE_MASK, OACC_KERNELS_CLAUSE_MASK)
525 (OACC_LOOP_CLAUSE_MASK, OACC_PARALLEL_CLAUSE_MASK)
526 (OACC_UPDATE_CLAUSE_MASK, OACC_WAIT_CLAUSE_MASK): New macros.
527 (cp_parser_omp_var_list_no_open): Handle OMP_CLAUSE__CACHE_.
528 (cp_parser_oacc_data_clause, cp_parser_oacc_data_clause_deviceptr)
529 (cp_parser_oacc_clause_vector_length, cp_parser_oacc_wait_list)
530 (cp_parser_oacc_clause_wait, cp_parser_omp_clause_num_gangs)
531 (cp_parser_omp_clause_num_workers, cp_parser_oacc_clause_async)
532 (cp_parser_oacc_all_clauses, cp_parser_oacc_cache)
533 (cp_parser_oacc_data, cp_parser_oacc_enter_exit_data)
534 (cp_parser_oacc_kernels, cp_parser_oacc_loop)
535 (cp_parser_oacc_parallel, cp_parser_oacc_update)
536 (cp_parser_oacc_wait): New functions.
537 * cp-tree.h (finish_oacc_data, finish_oacc_kernels)
538 (finish_oacc_parallel): New prototypes.
539 * semantics.c: Include "gomp-constants.h".
540 (handle_omp_array_sections): Handle GOMP_MAP_FORCE_DEVICEPTR. Use
541 GOMP_MAP_* instead of OMP_CLAUSE_MAP_*. Use
542 OMP_CLAUSE_SET_MAP_KIND.
543 (finish_omp_clauses): Handle OMP_CLAUSE_ASYNC,
544 OMP_CLAUSE_VECTOR_LENGTH, OMP_CLAUSE_WAIT, OMP_CLAUSE__CACHE_.
545 Use GOMP_MAP_* instead of OMP_CLAUSE_MAP_*.
546 (finish_oacc_data, finish_oacc_kernels, finish_oacc_parallel): New
549 2015-01-14 Paolo Carlini <paolo.carlini@oracle.com>
552 * decl2.c (var_defined_without_dynamic_init): Handle gracefully
555 2015-01-13 Jason Merrill <jason@redhat.com>
559 * constexpr.c (cxx_eval_binary_expression): Don't VERIFY_CONSTANT
561 (cxx_eval_increment_expression): Likewise.
564 * pt.c (coerce_template_parameter_pack): Return NULL for a
565 zero-length fixed parameter pack with a pack expansion arg.
568 * pt.c (unify): Don't try to deduce to std::initializer_list<T...>.
570 2015-01-12 Jason Merrill <jason@redhat.com>
573 * constexpr.c (cxx_eval_call_expression): A call to a void
574 function doesn't need to return a value.
576 2015-01-09 Michael Collison <michael.collison@linaro.org>
578 * call.c: Include hash-set.h, machmode.h, vec.h, double-int.h,
579 input.h, alias.h, symtab.h, options.h, fold-const.h,
580 wide-int.h, and inchash.h due to flattening of tree.h.
582 * constexpr.c: Ditto.
583 * cp-array-notation.c: Ditto.
584 * cp-gimplify.c: Ditto.
586 * cp-objcp-common.c: Ditto.
599 * name-lookup.c: Ditto.
607 * semantics.c: Ditto.
612 2015-01-08 Jason Merrill <jason@redhat.com>
614 * cp-gimplify.c (cp_genericize): Use do_ubsan_in_current_function.
615 * decl.c (compute_array_index_type): Likewise.
616 * init.c (build_vec_init): Likewise.
617 * typeck.c (cp_build_binary_op): Likewise.
619 2015-01-08 Jason Merrill <jason@redhat.com>
621 * init.c (build_vec_init): Call ubsan_instrument_bounds to check
622 whether an initializer-list is too big for a VLA.
623 (throw_bad_array_length): Remove.
624 * cp-tree.h: Remove prototype.
626 2015-01-08 Paolo Carlini <paolo.carlini@oracle.com>
629 * decl.c (grokfndecl): Add bool parameter.
630 (grokdeclarator): Adjust calls.
631 (start_decl): Don't set DECL_DELETED_FN here.
633 2015-01-06 Jason Merrill <jason@redhat.com>
635 * parser.c (cp_parser_nested_name_specifier_opt): Diagnose invalid
639 * pt.c (type_dependent_expression_p): Handle variable templates.
640 * constexpr.c (potential_constant_expression_1): Use it.
643 * semantics.c (finish_offsetof): Handle templates here.
644 * parser.c (cp_parser_builtin_offsetof): Not here.
647 * semantics.c (process_outer_var_ref): Diagnose lambda in local
650 2015-01-06 Ville Voutilainen <ville.voutilainen@gmail.com>
653 * class.c (check_field_decls): Make copy assignment operators
654 complex only in c++98 mode.
656 2015-01-05 Trevor Saunders <tsaunders@mozilla.com>
659 * class.c (check_for_override): Warn when a virtual function is an
660 override not marked override.
662 2015-01-05 Trevor Saunders <tsaunders@mozilla.com>
664 * class.c (warn_hidden): Use auto_vec<tree> instead of tree_list to
666 (get_basefndecls): Adjust.
668 2015-01-05 Jakub Jelinek <jakub@redhat.com>
670 Update copyright years.
672 2015-01-05 Marek Polacek <polacek@redhat.com>
675 * typeck.c (cp_build_array_ref): Pass loc down to
676 warn_array_subscript_with_type_char.
679 Copyright (C) 2015 Free Software Foundation, Inc.
681 Copying and distribution of this file, with or without modification,
682 are permitted in any medium without royalty provided the copyright
683 notice and this notice are preserved.