re PR c++/65072 (Segfault when parsing dectlype in trailing return type)
[platform/upstream/gcc.git] / gcc / cp / ChangeLog
1 2015-03-20  Marek Polacek  <polacek@redhat.com>
2
3         PR c++/65072
4         * typeck.c (lookup_anon_field): Make sure we're dealing with the main
5         variant.
6
7 2015-03-19  Jason Merrill  <jason@redhat.com>
8
9         PR c++/65046
10         Automatically propagate ABI tags to variables and functions
11         from their (return) type.
12         * class.c (check_tag): Handle variables and functions.
13         (mark_or_check_attr_tags): Split out from find_abi_tags_r.
14         (mark_or_check_tags): Likewise.
15         (mark_abi_tags): Use it.  Rename from mark_type_abi_tags.
16         (check_abi_tags): Add single argument overload for decls.
17         Handle inheriting tags for decls.
18         * mangle.c (write_mangled_name): Call it.
19         (mangle_return_type_p): Split out from write_encoding.
20         (unmangled_name_p): Split out from write_mangled_name.
21         (write_mangled_name): Ignore abi_tag on namespace.
22         * cp-tree.h (NAMESPACE_IS_INLINE): Replace NAMESPACE_ABI_TAG.
23         * parser.c (cp_parser_namespace_definition): Set it.
24         * name-lookup.c (handle_namespace_attrs): Use arguments. Warn
25         about abi_tag attribute on non-inline namespace.
26         * tree.c (check_abi_tag_args): Split out from handle_abi_tag_attribute.
27         (handle_abi_tag_attribute): Allow tags on variables.
28
29 2015-03-19  Jakub Jelinek  <jakub@redhat.com>
30
31         * decl2.c (cplus_decl_attributes): Also add "omp declare target"
32         attribute for DECL_EXTERNAL VAR_DECLs.
33
34 2015-03-18  Paolo Carlini  <paolo.carlini@oracle.com>
35
36         PR c++/65340
37         * call.c (build_over_call): Pass the tsubst_flags_t argument to
38         mark_used.
39         * decl2.c (mark_used): Inline the require_deduced_type call and
40         guard the error call.
41
42 2015-03-16  Jason Merrill  <jason@redhat.com>
43
44         PR c++/65061
45         * parser.c (cp_parser_template_name): Call strip_using_decl.
46
47 2015-03-16  Marek Polacek  <polacek@redhat.com>
48
49         DR 1688
50         PR c++/65327
51         * decl.c (grokdeclarator): Allow volatile and constexpr together.
52
53 2015-03-12  Paolo Carlini  <paolo.carlini@oracle.com>
54
55         PR c++/65323
56         * decl.c (check_default_argument): Don't call
57         maybe_warn_zero_as_null_pointer_constant.
58
59 2015-03-11  Aldy Hernandez  <aldyh@redhat.com>
60
61         * cp-gimplify.c (simple_empty_class_p): New.
62         * cp-gimplify.c (cp_gimplify_expr): Handle RETURN_EXPR.  Abstract
63         the code for empty class copies into simple_empty_class_p, and
64         adapt it to handle COMPOUND_EXPRs.
65
66 2015-03-10  Paolo Carlini  <paolo.carlini@oracle.com>
67
68         PR c++/65370
69         * decl.c (duplicate_decls): Call check_redeclaration_no_default_args
70         only if the location of newdecl doesn't match the location of olddecl.
71
72 2015-03-10  Jakub Jelinek  <jakub@redhat.com>
73
74         PR c++/65127
75         * parser.c (parsing_nsdmi): Don't return true if current_class_ptr
76         is not a PARM_DECL.
77
78 2015-03-10  Jason Merrill  <jason@redhat.com>
79
80         PR c++/65333
81         DR 1558
82         * pt.c (dependent_type_p_r): Check both class and alias template args.
83
84 2015-03-10  Jakub Jelinek  <jakub@redhat.com>
85
86         PR c/65120
87         * parser.c (cp_parser_binary_expression): Check for tcc_comparison
88         before preparing arguments to warn_logical_not_parentheses.
89         Use maybe_constant_value on rhs.
90
91 2015-03-09  Jason Merrill  <jason@redhat.com>
92
93         PR c++/65339
94         * call.c: Don't call maybe_resolve_dummy when calling a constructor.
95
96 2015-03-09  Jakub Jelinek  <jakub@redhat.com>
97
98         PR c/65120
99         * parser.c (cp_parser_binary_expression): Don't warn for
100         !!x == y or !b == y where b is bool.
101
102 2015-03-06  Aldy Hernandez  <aldyh@redhat.com>
103
104         * ptree.c (cxx_print_lambda_node): New.
105         (cxx_print_xnode): Handle LAMBDA_EXPR.
106
107 2015-03-03  Aldy Hernandez  <aldyh@redhat.com>
108
109         PR c++/65295
110         * constexpr.c (cxx_eval_constant_expression): Remove assert in
111         RESULT_DECL handling.
112
113 2015-02-26  Marek Polacek  <polacek@redhat.com>
114
115         PR c++/65202
116         * constexpr.c (cxx_eval_constant_expression): Don't evaluate
117         a RETURN_EXPR if its operand is null.
118
119 2015-02-25  Jason Merrill  <jason@redhat.com>
120
121         PR c++/65209
122         * decl2.c (constrain_visibility) [VISIBILITY_ANON]: Clear
123         DECL_COMDAT.
124         (constrain_visibility_for_template): Handle reference arguments.
125
126         PR debug/58315
127         * decl.c (start_preparsed_function): Use create_artificial_label
128         for cdtor_label.
129
130 2015-02-17  Paolo Carlini  <paolo.carlini@oracle.com>
131             Jakub Jelinek  <jakub@redhat.com>
132
133         PR c++/65075
134         * constexpr.c (check_constexpr_bind_expr_vars): Allow
135         implicit typedefs for lambda types.
136
137 2015-02-13  Paolo Carlini  <paolo.carlini@oracle.com>
138
139         PR c++/60894
140         * decl.c (lookup_and_check_tag): Use strip_using_decl.
141
142 2015-02-13  Jason Merrill  <jason@redhat.com>
143
144         PR c++/65054
145         * pt.c (template_args_equal): Look through conversions here.
146         * tree.c (cp_tree_equal): Not here.
147
148 2015-02-13  Paolo Carlini  <paolo.carlini@oracle.com>
149
150         PR c++/60211
151         * parser.c (cp_parser_pragma): Diagnose PRAGMA_IVDEP at
152         pragma_external context.
153
154 2015-02-13  Jason Merrill  <jason@redhat.com>
155
156         PR c++/65051
157         * call.c (reference_binding): Don't look for bad conversion
158         if TO is incomplete.
159
160 2015-02-13  Paolo Carlini  <paolo.carlini@oracle.com>
161
162         PR c++/64970
163         * decl.c (make_typename_type): Pass tsubst_flags_t argument
164         to lookup_template_class.
165
166 2015-02-13  Jakub Jelinek  <jakub@redhat.com>
167
168         PR ipa/65034
169         * decl.c (start_preparsed_function): Use void_type_node instead
170         of NULL_TREE as LABEL_DECL type.
171
172 2015-02-12  Jason Merrill  <jason@redhat.com>
173
174         PR c++/64898
175         * mangle.c (write_mangled_name): Fix test for variable template
176         instantiation.
177
178         * decl.c (begin_destructor_body): Condition clobber on
179         -flifetime-dse.
180
181 2015-02-12 Andrea Azzarone <azzaronea@gmail.com>
182
183         PR c++/64959
184         * parser.c (lookup_literal_operator): Return all candidates.
185         (cp_parser_userdef_char_literal): Simplify error handling.
186         (cp_parser_userdef_numeric_literal):  Pass tf_warning_or_error.
187         (cp_parser_userdef_string_literal): Pass tf_warning_or_error.
188         Also give higher priority to standard string UDL operator.
189
190 2015-02-12  Jakub Jelinek  <jakub@redhat.com>
191
192         PR debug/55541
193         * cp-tree.h (BLOCK_OUTER_CURLY_BRACE_P): Define.
194         * decl.c (poplevel): If functionbody, try not to create an extra
195         BLOCK for function body and use subblocks as that, if it is non-NULL
196         and doesn't have siblings.  Set BLOCK_OUTER_CURLY_BRACE_P flag.
197         (outer_curly_brace_block): Use BLOCK_OUTER_CURLY_BRACE_P flag.
198
199         PR sanitizer/64984
200         * except.c (check_noexcept_r): Return NULL for internal
201         calls.
202
203 2015-02-10  Jason Merrill  <jason@redhat.com>
204
205         PR c++/64994
206         * constexpr.c (cxx_eval_call_expression): Walk the clone list.
207
208 2015-02-10  Jan Hubicka  <hubicka@ucw.cz>
209
210         PR ipa/64982
211         * method.c (use_thunk): Do not check for stdarg thunks.
212
213 2015-02-06  Jason Merrill  <jason@redhat.com>
214
215         PR c++/64899
216         * init.c (build_vec_init): Handle default-initialized array with
217         constexpr default constructor.
218
219 2015-02-04  Jakub Jelinek  <jakub@redhat.com>
220
221         PR c/64824
222         PR c/64868
223         * parser.c (cp_parser_omp_atomic): Handle RDIV_EXPR.
224
225 2015-02-03  Paolo Carlini  <paolo.carlini@oracle.com>
226
227         PR c++/64877
228         * typeck.c (cp_build_binary_op): Avoid spurious -Waddress warnings
229         for generated expressions.
230
231 2015-02-02  Ville Voutilainen  <ville.voutilainen@gmail.com>
232
233         PR c++/64901
234         * decl.c (duplicate_decls): Also duplicate DECL_FINAL_P and
235         DECL_OVERRIDE_P.
236
237 2015-02-02  Jason Merrill  <jason@redhat.com>
238
239         * tree.c (handle_abi_tag_attribute): Diagnose invalid arguments.
240
241 2015-01-30  Joseph Myers  <joseph@codesourcery.com>
242
243         * class.c, except.c, parser.c, pt.c: All callers of fatal_error
244         changed to pass input_location as first argument.
245
246 2015-01-29  Jakub Jelinek  <jakub@redhat.com>
247
248         PR c++/64717
249         * cp-ubsan.c (cp_ubsan_instrument_vptr): Don't wrap vptr
250         into SAVE_EXPR.
251
252 2015-01-29  Jason Merrill  <jason@redhat.com>
253
254         PR c++/49508
255         * semantics.c (finish_return_stmt): Suppress -Wreturn-type on
256         erroneous return statement.
257
258         PR c++/64521
259         * repo.c (repo_emit_p): It's OK for a clone to be extern at this
260         point.
261
262 2015-01-27  Caroline Tice  <cmtice@google.com>
263
264         Committing VTV Cywin/Ming patch for Patrick Wollgast
265         * vtable-class-hierarchy.cc (vtv_generate_init_routine): Add
266         check for not TARGET_PECOFF at the VTV_PREINIT_PRIORITY checks.
267
268 2015-01-27  Jason Merrill  <jason@redhat.com>
269
270         PR c++/58597
271         * lambda.c (maybe_add_lambda_conv_op): Check cfun rather than
272         current_function_decl.
273
274         PR c++/63889
275         * pt.c (finish_template_variable): Move from semantics.c.
276         Handle multiple template arg levels.  Handle coercion here.
277         (lookup_template_variable): Not here.
278
279 2015-01-23  Jason Merrill  <jason@redhat.com>
280
281         PR c++/64314
282         PR c++/57510
283         * typeck2.c (split_nonconstant_init_1): Remove a sub-CONSTRUCTOR
284         that has been completely split out.
285
286         PR c++/64701
287         * constexpr.c (cxx_eval_constant_expression): Don't crash on C++
288         statement codes.
289
290         PR c++/64727
291         * constexpr.c (cxx_eval_constant_expression): Allow for lvalue use
292         of CONST_DECL.
293
294 2015-01-21  Jason Merrill  <jason@redhat.com>
295
296         PR c++/64603
297         * constexpr.c (cxx_eval_constant_expression): Only shortcut
298         constant CONSTRUCTORs.
299
300         PR c++/64647
301         * constexpr.c (ensure_literal_type_for_constexpr_object): Don't
302         give a hard error in a template instantiation.
303
304 2015-01-21  Richard Biener  <rguenther@suse.de>
305
306         PR middle-end/64313
307         * decl.c (duplicate_decls): Call set_builtin_decl_declared_p
308         for builtins the user declared correctly.
309
310 2015-01-16  Paolo Carlini  <paolo.carlini@oracle.com>
311
312         PR c++/58614
313         * pt.c (unify): When BRACE_ENCLOSED_INITIALIZER_P (arg), handle
314         TREE_TYPE (elt) == error_mark_node.
315
316 2015-01-15  Jan Hubicka  <hubicka@ucw.cz>
317
318         PR tree-optimization/62053
319         * tree.c (build_cplus_array_type): Layout type after variants are set.
320
321 2015-01-15  Jakub Jelinek  <jakub@redhat.com>
322
323         * cp-gimplify.c (cp_genericize_r): Call
324         cp_ubsan_maybe_instrument_member_call for member calls.
325         (cp_ubsan_check_member_access_r): New function.
326         (cp_genericize_tree): Call cp_ubsan_instrument_member_accesses.
327         * cp-tree.h (cp_ubsan_maybe_instrument_member_call,
328         cp_ubsan_instrument_member_accesses,
329         cp_ubsan_maybe_instrument_downcast,
330         cp_ubsan_maybe_instrument_cast_to_vbase): New prototypes.
331         * cp-ubsan.c: New file.
332         * Make-lang.in (CXX_AND_OBJCXX_OBJS): Add cp/cp-ubsan.o.
333         * constexpr.c (cxx_eval_call_expression): Return void_node
334         for IFN_UBSAN_VPTR.
335         (potential_constant_expression_1): Return true for
336         UBSAN_NULL, UBSAN_BOUNDS and UBSAN_VPTR internal calls.
337         * typeck.c (build_class_member_access_expr): Provide locus
338         for COMPONENT_REFs.
339         (build_static_cast_1): Instrument downcasts.
340         * class.c (build_base_path): For -fsanitize=vptr and !fixed_type_p
341         add ubsan instrumentation for virtual_access.
342         * call.c: Include internal-fn.h.
343         (set_flags_from_callee): Handle internal calls.
344
345 2015-01-15  Momchil Velikov  <momchil.velikov@gmail.com>
346
347         PR c++/59366
348         * name-lookup.c (pushdecl_maybe_friend_1): Hide friend functions
349         and function templates, declared only in the class.
350         * decl.c (duplicate_decls): Reveal hidden friend functions or
351         function templates, if they are redeclared outside the class.
352
353 2015-01-15  Jason Merrill  <jason@redhat.com>
354
355         PR c++/64356
356         * constexpr.c (cxx_eval_binary_expression): Fix pasto.
357
358         PR c++/63283
359         * constexpr.c (potential_constant_expression_1): Handle reference
360         args in templates.
361
362 2015-01-15  Thomas Schwinge  <thomas@codesourcery.com>
363             James Norris  <jnorris@codesourcery.com>
364             Cesar Philippidis  <cesar@codesourcery.com>
365             Ilmir Usmanov  <i.usmanov@samsung.com>
366             Jakub Jelinek  <jakub@redhat.com>
367
368         * parser.c: Include "gomp-constants.h".
369         (cp_parser_omp_clause_map): Use enum gomp_map_kind instead of enum
370         omp_clause_map_kind.  Use GOMP_MAP_* instead of OMP_CLAUSE_MAP_*.
371         Use OMP_CLAUSE_SET_MAP_KIND.
372         (cp_parser_omp_construct, cp_parser_pragma): Handle
373         PRAGMA_OACC_CACHE, PRAGMA_OACC_DATA, PRAGMA_OACC_ENTER_DATA,
374         PRAGMA_OACC_EXIT_DATA, PRAGMA_OACC_KERNELS, PRAGMA_OACC_PARALLEL,
375         PRAGMA_OACC_LOOP, PRAGMA_OACC_UPDATE, PRAGMA_OACC_WAIT.
376         (cp_parser_omp_clause_name): Handle "async", "copy", "copyout",
377         "create", "delete", "deviceptr", "host", "num_gangs",
378         "num_workers", "present", "present_or_copy", "pcopy",
379         "present_or_copyin", "pcopyin", "present_or_copyout", "pcopyout",
380         "present_or_create", "pcreate", "vector_length", "wait".
381         (OACC_DATA_CLAUSE_MASK, OACC_ENTER_DATA_CLAUSE_MASK)
382         (OACC_EXIT_DATA_CLAUSE_MASK, OACC_KERNELS_CLAUSE_MASK)
383         (OACC_LOOP_CLAUSE_MASK, OACC_PARALLEL_CLAUSE_MASK)
384         (OACC_UPDATE_CLAUSE_MASK, OACC_WAIT_CLAUSE_MASK): New macros.
385         (cp_parser_omp_var_list_no_open): Handle OMP_CLAUSE__CACHE_.
386         (cp_parser_oacc_data_clause, cp_parser_oacc_data_clause_deviceptr)
387         (cp_parser_oacc_clause_vector_length, cp_parser_oacc_wait_list)
388         (cp_parser_oacc_clause_wait, cp_parser_omp_clause_num_gangs)
389         (cp_parser_omp_clause_num_workers, cp_parser_oacc_clause_async)
390         (cp_parser_oacc_all_clauses, cp_parser_oacc_cache)
391         (cp_parser_oacc_data, cp_parser_oacc_enter_exit_data)
392         (cp_parser_oacc_kernels, cp_parser_oacc_loop)
393         (cp_parser_oacc_parallel, cp_parser_oacc_update)
394         (cp_parser_oacc_wait): New functions.
395         * cp-tree.h (finish_oacc_data, finish_oacc_kernels)
396         (finish_oacc_parallel): New prototypes.
397         * semantics.c: Include "gomp-constants.h".
398         (handle_omp_array_sections): Handle GOMP_MAP_FORCE_DEVICEPTR.  Use
399         GOMP_MAP_* instead of OMP_CLAUSE_MAP_*.  Use
400         OMP_CLAUSE_SET_MAP_KIND.
401         (finish_omp_clauses): Handle OMP_CLAUSE_ASYNC,
402         OMP_CLAUSE_VECTOR_LENGTH, OMP_CLAUSE_WAIT, OMP_CLAUSE__CACHE_.
403         Use GOMP_MAP_* instead of OMP_CLAUSE_MAP_*.
404         (finish_oacc_data, finish_oacc_kernels, finish_oacc_parallel): New
405         functions.
406
407 2015-01-14  Paolo Carlini  <paolo.carlini@oracle.com>
408
409         PR c++/58671
410         * decl2.c (var_defined_without_dynamic_init): Handle gracefully
411         self-initialization.
412
413 2015-01-13  Jason Merrill  <jason@redhat.com>
414
415         PR c++/64356
416         PR libstdc++/58777
417         * constexpr.c (cxx_eval_binary_expression): Don't VERIFY_CONSTANT
418         pointer expressions.
419         (cxx_eval_increment_expression): Likewise.
420
421         PR c++/64514
422         * pt.c (coerce_template_parameter_pack): Return NULL for a
423         zero-length fixed parameter pack with a pack expansion arg.
424
425         PR c++/64520
426         * pt.c (unify): Don't try to deduce to std::initializer_list<T...>.
427
428 2015-01-12  Jason Merrill  <jason@redhat.com>
429
430         PR c++/64547
431         * constexpr.c (cxx_eval_call_expression): A call to a void
432         function doesn't need to return a value.
433
434 2015-01-09  Michael Collison  <michael.collison@linaro.org>
435
436         * call.c: Include hash-set.h, machmode.h, vec.h, double-int.h,
437         input.h, alias.h, symtab.h, options.h, fold-const.h,
438         wide-int.h, and inchash.h due to flattening of tree.h.
439         * class.c: Ditto.
440         * constexpr.c: Ditto.
441         * cp-array-notation.c: Ditto.
442         * cp-gimplify.c: Ditto.
443         * cp-lang.c: Ditto.
444         * cp-objcp-common.c: Ditto.
445         * cvt.c: Ditto.
446         * decl2.c: Ditto.
447         * decl.c: Ditto.
448         * dump.c: Ditto.
449         * error.c: Ditto.
450         * except.c: Ditto.
451         * expr.c: Ditto.
452         * friend.c: Ditto.
453         * init.c: Ditto.
454         * lambda.c: Ditto.
455         * lex.c: Ditto.
456         * mangle.c: Ditto.
457         * name-lookup.c: Ditto.
458         * optimize.c: Ditto.
459         * parser.c: Ditto.
460         * pt.c: Ditto.
461         * ptree.c: Ditto.
462         * repo.c: Ditto.
463         * rtti.c: Ditto.
464         * search.c: Ditto.
465         * semantics.c: Ditto.
466         * tree.c: Ditto.
467         * typeck2.c: Ditto.
468         * typeck.c: Ditto.
469
470 2015-01-08  Jason Merrill  <jason@redhat.com>
471
472         * cp-gimplify.c (cp_genericize): Use do_ubsan_in_current_function.
473         * decl.c (compute_array_index_type): Likewise.
474         * init.c (build_vec_init): Likewise.
475         * typeck.c (cp_build_binary_op): Likewise.
476
477 2015-01-08  Jason Merrill  <jason@redhat.com>
478
479         * init.c (build_vec_init): Call ubsan_instrument_bounds to check
480         whether an initializer-list is too big for a VLA.
481         (throw_bad_array_length): Remove.
482         * cp-tree.h: Remove prototype.
483
484 2015-01-08  Paolo Carlini  <paolo.carlini@oracle.com>
485
486         PR c++/60753
487         * decl.c (grokfndecl): Add bool parameter.
488         (grokdeclarator): Adjust calls.
489         (start_decl): Don't set DECL_DELETED_FN here.
490
491 2015-01-06  Jason Merrill  <jason@redhat.com>
492
493         * parser.c (cp_parser_nested_name_specifier_opt): Diagnose invalid
494         template-ids.
495
496         PR c++/64455
497         * pt.c (type_dependent_expression_p): Handle variable templates.
498         * constexpr.c (potential_constant_expression_1): Use it.
499
500         PR c++/64487
501         * semantics.c (finish_offsetof): Handle templates here.
502         * parser.c (cp_parser_builtin_offsetof): Not here.
503
504         PR c++/64496
505         * semantics.c (process_outer_var_ref): Diagnose lambda in local
506         class NSDMI.
507
508 2015-01-06  Ville Voutilainen  <ville.voutilainen@gmail.com>
509
510         PR c++/64489
511         * class.c (check_field_decls): Make copy assignment operators
512         complex only in c++98 mode.
513
514 2015-01-05  Trevor Saunders  <tsaunders@mozilla.com>
515
516         PR c++/31397
517         * class.c (check_for_override): Warn when a virtual function is an
518         override not marked override.
519
520 2015-01-05  Trevor Saunders  <tsaunders@mozilla.com>
521
522         * class.c (warn_hidden): Use auto_vec<tree> instead of tree_list to
523         hold base_fndecls.
524         (get_basefndecls): Adjust.
525
526 2015-01-05  Jakub Jelinek  <jakub@redhat.com>
527
528         Update copyright years.
529
530 2015-01-05  Marek Polacek  <polacek@redhat.com>
531
532         PR c/64423
533         * typeck.c (cp_build_array_ref): Pass loc down to
534         warn_array_subscript_with_type_char.
535
536 \f
537 Copyright (C) 2015 Free Software Foundation, Inc.
538
539 Copying and distribution of this file, with or without modification,
540 are permitted in any medium without royalty provided the copyright
541 notice and this notice are preserved.