decl.c (start_decl): Look through member variable template.
[gcc.git] / gcc / cp / ChangeLog
1 2014-08-25 Jason Merrill <jason@redhat.com>
2
3 * decl.c (start_decl): Look through member variable template.
4 * pt.c (tsubst_decl) [VAR_DECL]: Handle member variable templates.
5 * decl2.c (grokfield): Set DECL_CONTEXT earlier on
6 variables.
7
8 2014-08-25 Paolo Carlini <paolo.carlini@oracle.com>
9
10 PR c++/34938
11 * cp-tree.h (TFF_POINTER): Add.
12 * cxx-pretty-print.h (pp_cxx_cv_qualifiers): Forward the third
13 argument too.
14 * error.c (dump_type_suffix): Actually print the const and noreturn
15 attribute when appropriate.
16
17 2014-08-23 Edward Smith-Rowland <3dw4rd@verizon.net>
18
19 * decl.c (compute_array_index_type, grokdeclarator,
20 undeduced_auto_decl): Change from cxx1y to cxx14.
21 *lambda.c(add_capture()): Change error message from C++1y to C++14.
22 * parser.c (cp_parser_unqualified_id, cp_parser_pseudo_destructor_name,
23 cp_parser_lambda_introducer, cp_parser_lambda_declarator_opt,
24 cp_parser_decltype, cp_parser_conversion_type_id,
25 cp_parser_simple_type_specifier, cp_parser_type_id_1,
26 cp_parser_template_type_arg, cp_parser_std_attribute,
27 cp_parser_template_declaration_after_export): Ditto.
28 * pt.c (tsubst): Ditto.
29 * semantics.c (force_paren_expr, finish_decltype_type): Ditto.
30 * tree.c: Change comment.
31 * typeck.c (comp_template_parms_position, cxx_sizeof_or_alignof_type,
32 cp_build_addr_expr_1, maybe_warn_about_useless_cast): Ditto.
33
34 2014-08-23 Jason Merrill <jason@redhat.com>
35
36 Allow non-constexpr variable templates.
37 * decl2.c (note_variable_template_instantiation): New.
38 * cp-tree.h: Declare it.
39 * pt.c (instantiate_decl): Call it.
40 (push_template_decl_real): Allow non-constexpr variable templates.
41 * semantics.c (finish_id_expression): Mark the variable template
42 instantiation as used.
43 * mangle.c (write_mangled_name): Variable template instantiations
44 are mangled.
45 * parser.c (cp_parser_init_declarator): Complain about
46 non-function implicit templates.
47
48 2014-08-22 Marek Polacek <polacek@redhat.com>
49
50 PR c++/62199
51 * parser.c (cp_parser_binary_expression): Check each LHS if it's
52 preceded with logical not. Adjust call to
53 warn_logical_not_parentheses.
54
55 2014-08-22 Manuel López-Ibáñez <manu@gcc.gnu.org>
56
57 PR c++/57709
58 * name-lookup.c (pushdecl_maybe_friend_1): Do not warn if a
59 declaration shadows a function declaration, unless the former
60 declares a function, pointer to function or pointer to member
61 function, because this is a common and valid case in real-world
62 code.
63 * cp-tree.h (TYPE_PTRFN_P,TYPE_REFFN_P,TYPE_PTRMEMFUNC_P):
64 Improve description.
65
66 2014-08-22 Jason Merrill <jason@redhat.com>
67
68 PR c++/62129
69 * class.c (outermost_open_class): Fix logic.
70 * decl.c (complete_vars): Fix logic.
71
72 2014-08-22 Jason Merrill <jason@redhat.com>
73
74 PR c++/62129
75 * class.c (outermost_open_class): New.
76 * cp-tree.h: Declare it.
77 * decl.c (maybe_register_incomplete_var): Use it.
78 (complete_vars): Handle any constant variable.
79 * expr.c (cplus_expand_constant): Handle CONSTRUCTOR.
80
81 2014-08-22 Igor Zamyatin <igor.zamyatin@intel.com>
82
83 PR other/62008
84 * cp-array-notation.c (build_array_notation_ref): Added correct
85 handling of case with incorrect array.
86
87 2014-08-21 Manuel López-Ibáñez <manu@gcc.gnu.org>
88
89 PR fortran/44054
90 * error.c (cp_diagnostic_finalizer): Delete.
91 (init_error): Do not set diagnostic_finalizer here.
92
93 2014-08-19 Marek Polacek <polacek@redhat.com>
94
95 PR c++/62153
96 * call.c (build_new_op_1): Remember the type of arguments for
97 a comparison. If either operand of a comparison is a boolean
98 expression, call maybe_warn_bool_compare.
99
100 2014-08-19 Jason Merrill <jason@redhat.com>
101
102 PR tree-optimization/62091
103 * decl2.c (decl_needed_p): Return true for virtual functions when
104 devirtualizing.
105
106 PR lto/53808
107 PR c++/61659
108 * decl.c (maybe_commonize_var): Don't use DECL_COMDAT to trigger
109 comdat_linkage.
110
111 2014-08-19 Gerald Pfeifer <gerald@pfeifer.com>
112
113 * class.c (contains_empty_class_p): Remove.
114
115 2014-08-18 Paolo Carlini <paolo.carlini@oracle.com>
116
117 * parser.c (cp_parser_expression): Add default arguments.
118 (cp_parser_primary_expression, cp_parser_postfix_expression,
119 cp_parser_array_notation, cp_parser_postfix_open_square_expression,
120 cp_parser_unary_expression, cp_parser_direct_new_declarator,
121 cp_parser_question_colon_clause, cp_parser_assignment_operator_opt,
122 cp_parser_lambda_body, cp_parser_expression_statement,
123 cp_parser_condition, cp_parser_c_for, cp_parser_range_for,
124 cp_parser_iteration_statement, cp_parser_jump_statement,
125 cp_parser_decltype_expr, cp_parser_noexcept_specification_opt,
126 cp_parser_asm_operand_list, cp_parser_objc_message_receiver,
127 cp_parser_objc_synchronized_statement, cp_parser_objc_throw_statement,
128 cp_parser_omp_var_list_no_open, cp_parser_omp_clause_num_threads,
129 cp_parser_omp_clause_num_teams, cp_parser_omp_clause_thread_limit,
130 cp_parser_omp_clause_linear, cp_parser_omp_clause_device,
131 cp_parser_omp_atomic, cp_parser_omp_for_loop_init,
132 cp_parser_omp_for_loop, cp_parser_omp_declare_reduction_exprs,
133 cp_parser_transaction_expression): Adjust.
134
135 2014-08-15 Jason Merrill <jason@redhat.com>
136
137 PR c++/61566
138 * pt.c (lookup_template_class_1): Revert recent change.
139 * mangle.c (CLASSTYPE_TEMPLATE_ID_P): Revert recent change.
140
141 PR c++/61566
142 * pt.c (instantiate_class_template_1): Ignore lambda on
143 CLASSTYPE_DECL_LIST.
144 (push_template_decl_real): A lambda is not primary.
145 (lookup_template_class_1): Don't look for a lambda partial
146 instantiation.
147 * lambda.c (maybe_add_lambda_conv_op): Distinguish between being
148 currently in a function and the lambda living in a function.
149 * mangle.c (CLASSTYPE_TEMPLATE_ID_P): False for lambda.
150
151 2014-08-15 Richard Biener <rguenther@suse.de>
152 Jason Merrill <jason@redhat.com>
153
154 PR bootstrap/62077
155 * tree.c (build_min_array_type, set_array_type_canon): Split out...
156 (build_cplus_array_type): ...from here. Only call build_array_type
157 for main variants.
158
159 2014-08-15 Paolo Carlini <paolo.carlini@oracle.com>
160
161 PR c++/62072
162 Revert:
163 2014-07-09 Paolo Carlini <paolo.carlini@oracle.com>
164
165 DR 1584
166 PR c++/57466
167 * pt.c (check_cv_quals_for_unify): Implement resolution, disregard
168 cv-qualifiers of function types.
169
170 2014-08-15 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
171
172 * call.c (build_conditional_expr_1): Use OPT_Wextra in warning.
173
174 2014-08-14 Paolo Carlini <paolo.carlini@oracle.com>
175
176 * typeck.c (composite_pointer_type, cxx_sizeof_or_alignof_type,
177 cp_build_array_ref, cp_build_function_call_vec): When a
178 pedwarn is suppressed under SFINAE, return error_mark_node.
179
180 * typeck.c (cxx_sizeof_or_alignof_type): Fix complain &
181 tf_warning_or_error, where complain is a bool, glitch.
182
183 2014-08-14 Ville Voutilainen <ville.voutilainen@gmail.com>
184
185 PR c++/62101
186 * decl.c (grokdeclarator): Move the check for friend initializers..
187 * decl2.c (grokfield) ..here. Postpone early return for friends
188 until after the initializer check.
189
190 2014-08-14 Paolo Carlini <paolo.carlini@oracle.com>
191
192 PR c++/54377
193 * pt.c (coerce_template_parms): Improve error message vs default
194 arguments.
195
196 2014-08-14 Paolo Carlini <paolo.carlini@oracle.com>
197
198 * parser.c (cp_parser_init_declarator): Remove redundant check of
199 decl_specifiers->type.
200
201 2014-08-13 Jason Merrill <jason@redhat.com>
202
203 * call.c (build_x_va_arg): Support passing non-POD through ....
204 (convert_arg_to_ellipsis): Likewise.
205
206 2014-08-13 Andrew Sutton <andrew.n.sutton@gmail.com>
207
208 * pt.c (lookup_template_variable): Make dependent variable templates
209 have unknown type.
210
211 2014-08-13 Paolo Carlini <paolo.carlini@oracle.com>
212
213 * parser.c (cp_parser_elaborated_type_specifier): Handle
214 specially cp_parser_template_id returning a BASELINK.
215
216 2014-08-13 Paolo Carlini <paolo.carlini@oracle.com>
217
218 * parser.c (cp_parser_diagnose_invalid_type_name,
219 cp_parser_make_typename_type): Remove scope parameter.
220 (cp_parser_parse_and_diagnose_invalid_type_name,
221 cp_parser_elaborated_type_specifier): Adjust calls.
222
223 2014-08-12 Ville Voutilainen <ville.voutilainen@gmail.com>
224
225 Reject virt-specifiers on friends and member templates
226 * friend.c (do_friend): Diagnose virt-specifiers.
227 * pt.c (push_template_decl_real): Diagnose virt-specifiers.
228
229 2014-08-09 Paolo Carlini <paolo.carlini@oracle.com>
230
231 * typeck2.c (check_narrowing): Add tsubst_flags_t parameter, change
232 return type to bool; in C++11 for constants give errors, not pedwarns.
233 * cp-tree.h (check_narrowing): Adjust declaration.
234 * call.c (convert_like_real): Update calls.
235 * semantics.c (finish_compound_literal): Likewise.
236
237 2014-08-08 Jason Merrill <jason@redhat.com>
238
239 * pt.c (lookup_template_class_1): Copy abi_tag.
240
241 2014-08-08 Kai Tietz <ktietz@redhat.com>
242
243 * semantics.c (expand_or_defer_fn_1): Check for keep-inline-dllexport
244 that we operate on a true inline.
245
246 2014-08-07 Trevor Saunders <tsaunders@mozilla.com>
247
248 * class.c, cp-gimplify.c, decl.c, decl2.c, error.c, method.c,
249 optimize.c, pt.c, semantics.c: Remove includes of pointer-set.h.
250
251 2014-08-07 Paolo Carlini <paolo.carlini@oracle.com>
252
253 PR c++/51312
254 * decl.c (build_enumerator): Handle class types with conversion
255 operators via perform_implicit_conversion_flags and
256 build_expr_type_conversion.
257
258 * cvt.c (build_expr_type_conversion): Replace pair of errors
259 with error + inform.
260
261 2014-08-07 Jason Merrill <jason@redhat.com>
262
263 PR c++/62043
264 * parser.c (c_parse_file): Change sorry to fatal_error.
265
266 PR c++/61959
267 * semantics.c (cxx_eval_bare_aggregate): Handle POINTER_PLUS_EXPR.
268
269 2014-08-07 Trevor Saunders <tsaunders@mozilla.com>
270
271 * cp-tree.h, pt.c: Use hash_map instead of pointer_map.
272
273 2014-08-06 Jason Merrill <jason@redhat.com>
274
275 * init.c (build_vec_init): Fix constant initialization of
276 trailing elements.
277 (build_value_init_noctor): Call maybe_constant_init.
278 * semantics.c (maybe_constant_init): See through EXPR_STMT and
279 conversion to void.
280
281 PR c++/60417
282 * init.c (build_vec_init): Reorganize earlier change a bit.
283
284 PR c++/61994
285 * init.c (build_vec_init): Leave atype an ARRAY_TYPE
286 if we're just returning an INIT_EXPR.
287
288 2014-08-06 Jason Merrill <jason@redhat.com>
289 Braden Obrzut <admin@maniacsvault.net>
290
291 * pt.c (check_explicit_specialization): Don't test
292 DECL_DECLARED_INLINE_P for a variable template.
293
294 2014-08-06 Paolo Carlini <paolo.carlini@oracle.com>
295
296 PR c++/43906
297 * typeck.c (cp_build_binary_op): Extend to more cases the
298 -Waddress warning.
299
300 2014-08-01 Braden Obrzut <admin@maniacsvault.net>
301
302 Implement constexpr variable templates
303 * decl.c (grokvardecl): Handle specializations of variable templates.
304 (grokdeclarator): Handle variable template id expressions and NULL_TREE
305 return from grokvardecl.
306 * decl2.c (check_member_template): Allow declaration of template member
307 variables.
308 * parser.c (cp_parser_template_id): Build a TEMPLATE_ID_EXPR for
309 variable templates.
310 * pt.c (check_template_variable): Accept variable temploids at
311 non-class scope.
312 (push_template_decl_real): The current instantiation of a template
313 can be a VAR_DECL.
314 (determine_specialization): Accept variable templates.
315 (check_explicit_specialization): Handle and check for malformed
316 variable template specializations.
317 (lookup_template_variable): New.
318 (tsubst_decl): Handle variable template specializations.
319 (do_decl_instantiation): Handle template variables.
320 (instantiate_decl): Handle template variables.
321 * semantics.c (finish_template_variable): New.
322 (finish_id_expression): Instantiate variable templates.
323 * cp-tree.h (variable_template_p): New.
324
325 2014-08-02 Paolo Carlini <paolo.carlini@oracle.com>
326
327 PR c++/15339
328 * decl.c (check_redeclaration_no_default_args): New.
329 (duplicate_decls): Use it, handle default arguments
330 in redeclarations of function templates.
331
332 2014-08-02 Trevor Saunders <tsaunders@mozilla.com>
333
334 * optimize.c, semantics.c: Use hash_map instead of pointer_map.
335
336 2014-08-02 Trevor Saunders <tsaunders@mozilla.com>
337
338 * class.c, cp-gimplify.c, cp-tree.h, decl.c, decl2.c, error.c,
339 method.c, name-lookup.c, pt.c, semantics.c, tree.c: Use hash_set
340 instead of pointer_set.
341
342 2014-08-01 Jason Merrill <jason@redhat.com>
343
344 PR c++/60417
345 * init.c (build_vec_init): Set CONSTRUCTOR_IS_DIRECT_INIT on
346 init-list for trailing elements.
347 * typeck2.c (process_init_constructor_array): Likewise.
348
349 2014-08-01 Paolo Carlini <paolo.carlini@oracle.com>
350
351 DR 217 again
352 * decl.c (duplicate_decls): Handle static member functions too.
353
354 2014-08-01 Igor Zamyatin <igor.zamyatin@intel.com>
355
356 * cp-array-notation.c (expand_an_in_modify_expr): Fix the misprint
357 in error output.
358
359 2014-08-01 Igor Zamyatin <igor.zamyatin@intel.com>
360
361 PR other/61963
362 * parser.c (cp_parser_array_notation): Added check for array_type.
363
364 2014-08-01 Igor Zamyatin <igor.zamyatin@intel.com>
365
366 PR middle-end/61455
367 * cp-array-notation.c (expand_array_notation_exprs): Handling of
368 DECL_EXPR improved. Changed handling for INIT_EXPR.
369
370 2014-08-01 Paolo Carlini <paolo.carlini@oracle.com>
371
372 * pt.c (lookup_template_class_1): Use DECL_TYPE_TEMPLATE_P.
373
374 2014-08-01 Jakub Jelinek <jakub@redhat.com>
375
376 * cp-gimplify.c (cp_genericize_r): For -fsanitize=null and/or
377 -fsanitize=alignment call ubsan_maybe_instrument_reference
378 for casts to REFERENCE_TYPE and ubsan_maybe_instrument_member_call
379 for calls to member functions.
380
381 2014-07-31 Marc Glisse <marc.glisse@inria.fr>
382
383 PR c++/60517
384 * typeck.c (maybe_warn_about_returning_address_of_local): Return
385 whether it is returning the address of a local variable.
386 (check_return_expr): Return 0 instead of the address of a local
387 variable.
388
389 2014-07-30 Jason Merrill <jason@redhat.com>
390
391 PR lto/53808
392 PR c++/61659
393 * pt.c (push_template_decl_real): Don't set DECL_COMDAT on friends.
394
395 2014-07-30 Paolo Carlini <paolo.carlini@oracle.com>
396
397 PR c++/57397
398 * pt.c (unify_arity): Add boolean parameter.
399 (unify_too_few_arguments): Likewise.
400 (type_unification_real): Diagnose correctly insufficient
401 arguments in the presence of trailing variadic parameters;
402 deducing multiple trailing packs as empty is fine.
403
404 2014-07-30 Jason Merrill <jason@redhat.com>
405
406 PR c++/61659
407 PR c++/61687
408 Revert:
409 * decl2.c (mark_all_virtuals): New variable.
410 (maybe_emit_vtables): Check it instead of flag_devirtualize.
411 (cp_write_global_declarations): Set it and give helpful diagnostic
412 if it introduces errors.
413 * class.c (finish_struct_1): Check it.
414
415 PR lto/53808
416 PR c++/61659
417 * pt.c (push_template_decl_real): Set DECL_COMDAT on templates.
418 (check_explicit_specialization): Clear it on specializations.
419 * decl.c (duplicate_decls, start_decl): Likewise.
420 (grokmethod, grokfndecl): Set DECL_COMDAT on inlines.
421 * method.c (implicitly_declare_fn): Set DECL_COMDAT. Determine
422 linkage after setting the appropriate flags.
423 * tree.c (decl_linkage): Don't check DECL_COMDAT.
424 * decl2.c (mark_needed): Mark clones.
425 (import_export_decl): Not here.
426
427 2014-07-25 Edward Smith-Rowland <3dw4rd@verizon.net>
428
429 Implement N4051 - Allow typename in a template template parameter
430 * parser.c (cp_parser_type_parameter_key): New funtion;
431 (cp_parser_token_is_type_parameter_key): Ditto;
432 (cp_parser_type_parameter): Look for type-parameter-key for all versions
433 but pedwarn for less than cxx1z.
434
435 2014-07-17 Paolo Carlini <paolo.carlini@oracle.com>
436
437 PR c++/50961
438 * call.c (standard_conversion): Use resolve_nondeduced_context
439 for type_unknown_p (EXPR) && TREE_CODE (TO) == BOOLEAN_TYPE.
440
441 2014-07-17 Paolo Carlini <paolo.carlini@oracle.com>
442
443 PR c++/61804
444 * parser.c (cp_parser_tokens_start_cast_expression): Return -1
445 for '++' and '--'.
446
447 2014-07-15 Jason Merrill <jason@redhat.com>
448
449 PR c++/61811
450 * decl2.c (maybe_emit_vtables): Return true for -fuse-all-virtuals.
451
452 PR c++/60848
453 PR c++/61723
454 * call.c (is_std_init_list): Don't check CLASSTYPE_TEMPLATE_INFO.
455 * class.c (finish_struct): Reject invalid definition of
456 std::initializer_list.
457
458 2014-07-15 Paolo Carlini <paolo.carlini@oracle.com>
459
460 * call.c (convert_like_real): Call print_z_candidate and inform only
461 if permerror returns true.
462
463 2014-07-14 Jan Hubicka <hubicka@ucw.cz>
464
465 * class.c (build_clone): Do not clear assembler names of
466 templates.
467 * decl.c (cp_tree_node_structure): Add TEMPLATE_DECL.
468 * cp-objcp-common.c (cp_tree_size): Add TEMPLATE_DECL
469 as a special case return sizeof (struct tree_decl_non_common)
470 for other decls.
471 (cp_common_init_ts): Do not initialize NAMESPACE_DECL;
472 initialize TEMPLATE_DECL as MARK_TS_DECL_COMMON.
473 * cp/cp-tree.h (tree_template_decl): New structure.
474 (cp_tree_node_structure_enum): Add TS_CP_TEMPLATE_DECL.
475 (union cp_lang_tree_node): Add template_decl.
476 (DECL_TEMPLATE_PARMS, DECL_TEMPLATE_RESULT): Update.
477
478 2014-07-14 Jason Merrill <jason@redhat.com>
479
480 PR c++/61445
481 PR c++/56947
482 * pt.c (instantiate_decl): Don't check defer_ok for local class
483 members.
484
485 2014-07-14 Jakub Jelinek <jakub@redhat.com>
486
487 PR middle-end/61294
488 * cp-tree.h (LITERAL_ZERO_P): Define.
489 * parser.c (cp_parser_parenthesized_expression_list): Add
490 want_literal_zero_p argument, if true, for literal zeros
491 insert INTEGER_CSTs with LITERAL_ZERO_P flag set.
492 (cp_parser_postfix_expression): Adjust
493 cp_parser_parenthesized_expression_list caller, handle
494 -Wmemset-transposed-args.
495 (literal_zeros): New variable.
496
497 2014-07-13 Jason Merrill <jason@redhat.com>
498
499 PR c++/58511
500 * semantics.c (is_instantiation_of_constexpr): Return true for
501 defaulted functions, too.
502 (explain_invalid_constexpr_fn): Only use
503 explain_implicit_non_constexpr if !DECL_DECLARED_CONSTEXPR_P.
504 * method.c (explain_implicit_non_constexpr): Pass
505 DECL_INHERITED_CTOR_BASE to explain_implicit_non_constexpr.
506
507 PR c++/58611
508 * decl.c (check_initializer): Don't finish_compound_literal
509 on erroneous constexpr init.
510
511 PR c++/58612
512 * tree.c (bot_replace): Only replace a dummy 'this' parm.
513
514 PR c++/60628
515 * decl.c (create_array_type_for_decl): Only check for auto once.
516
517 PR c++/58636
518 * call.c (build_list_conv): Don't try to build a list of references.
519
520 2014-07-13 Edward Smith-Rowland <3dw4rd@verizon.net>
521
522 PR C++/60209 - Declaration of user-defined literal operator cause error
523 * parser.c (cp_parser_operator): Fold treatment of strings
524 and user-defined string literals. Use the full string parser.
525 (cp_parser_string_literal): Add flag to not look for literal operator.
526
527 2014-07-11 Jason Merrill <jason@redhat.com>
528
529 PR c++/22434
530 PR c++/61288
531 * call.c (build_conditional_expr_1): Avoid reading freed memory.
532
533 2014-07-11 Paolo Carlini <paolo.carlini@oracle.com>
534
535 PR c++/53159
536 * call.c (build_user_type_conversion_1): Copy LOOKUP_NO_NARROWING
537 into convflags.
538 * decl.c (check_initializer): Don't call check_narrowing here,
539 set LOOKUP_NO_NARROWING.
540 * typeck2.c (digest_init_r): Likewise.
541
542 2014-07-10 Jason Merrill <jason@redhat.com>
543
544 PR c++/61661
545 * semantics.c (reduced_constant_expression_p): Handle CONSTRUCTOR.
546
547 PR c++/61659
548 PR c++/61687
549 * decl2.c (mark_all_virtuals): New variable.
550 (maybe_emit_vtables): Check it instead of flag_devirtualize.
551 (cp_write_global_declarations): Set it and give helpful diagnostic
552 if it introduces errors.
553 * class.c (finish_struct_1): Check it.
554 * decl.c (grokdeclarator): Clear virtualp after 'virtual auto' error.
555
556 2014-07-09 Paolo Carlini <paolo.carlini@oracle.com>
557
558 PR c++/60686
559 * decl.c (grokdeclarator): Adjust error messages about 'explicit'
560 outside class declaration, in friend declaration, and neither on
561 constructor nor conversion operator.
562
563 2014-07-09 Paolo Carlini <paolo.carlini@oracle.com>
564
565 DR 1584
566 PR c++/57466
567 * pt.c (check_cv_quals_for_unify): Implement resolution, disregard
568 cv-qualifiers of function types.
569
570 2014-07-09 Andrew Sutton <andrew.n.sutton@gmail.com>
571 Paolo Carlini <paolo.carlini@oracle.com>
572
573 PR c++/59361
574 * parser.c (cp_parser_tokens_start_cast_expression): Return 0 for
575 CPP_ELLIPSIS too.
576
577 2014-07-07 Paolo Carlini <paolo.carlini@oracle.com>
578
579 * class.c (check_for_override): Wrap the 'final' and 'override'
580 keywords in %< and %>.
581
582 2014-07-06 Marek Polacek <polacek@redhat.com>
583
584 PR c/6940
585 * cp-tree.h (DECL_ARRAY_PARAMETER_P): Define.
586 * decl.c (grokdeclarator): Set DECL_ARRAY_PARAMETER_P.
587 * typeck.c (cxx_sizeof_expr): Warn when using sizeof on an array
588 function parameter.
589
590 2014-07-02 Paolo Carlini <paolo.carlini@oracle.com>
591
592 * pt.c (convert_template_argument): Use inform instead of error in
593 three places.
594
595 2014-06-30 Edward Smith-Rowland <3dw4rd@verizon.net>
596
597 PR c++/58781
598 PR c++/60249
599 PR c++/59867
600 * parser.c (cp_parser_userdef_string_literal): Take a tree
601 not a cp_token*.
602 (cp_parser_string_literal): Don't hack the token stream.
603
604 2014-06-30 Jason Merrill <jason@redhat.com>
605
606 PR c++/61659
607 PR lto/53808
608 * decl2.c (maybe_emit_vtables): Mark all vtable entries if
609 devirtualizing.
610 * init.c (build_vtbl_address): Don't mark destructor.
611 * class.c (finish_struct_1): Add all classes to keyed_classes
612 if devirtualizing.
613
614 PR c++/61647
615 * pt.c (type_dependent_expression_p): Check BASELINK_OPTYPE.
616
617 PR c++/61566
618 * mangle.c (decl_mangling_context): Look through a TEMPLATE_DECL.
619
620 * decl.c (build_ptrmemfunc_type): Don't give a PMF RECORD_TYPE
621 TYPE_BINFO or TYPE_LANG_SPECIFIC.
622 * cp-tree.h (TYPE_PTRMEMFUNC_FLAG): Use TYPE_LANG_FLAG_2.
623 (TYPE_PTRMEMFUNC_P): Don't expect TYPE_LANG_SPECIFIC.
624 * typeck.c (build_ptrmemfunc_access_expr): Don't use lookup_member.
625 * pt.c (unify): Also check whether the argument is a PMF.
626
627 2014-06-30 Paolo Carlini <paolo.carlini@oracle.com>
628
629 PR c++/54891
630 * parser.c (cp_parser_tokens_start_cast_expression): In C++11
631 a '[' can also start a primary-expression.
632 (cp_parser_cast_expression): Parse a cast-expression only tentatively
633 when cp_parser_tokens_start_cast_expression returns -1.
634
635 2014-06-30 Jason Merrill <jason@redhat.com>
636
637 PR c++/61539
638 * pt.c (unify_one_argument): Type/expression mismatch just causes
639 deduction failure.
640
641 * semantics.c (simplify_aggr_init_expr): Remove remnants of
642 2014-04-11 change.
643
644 2014-06-30 Marek Polacek <polacek@redhat.com>
645
646 * cp-gimplify.c (cp_genericize): Don't instrument returns if the
647 function has no_sanitize_undefined attribute.
648 * decl.c (compute_array_index_type): Don't instrument VLAs if the
649 function has no_sanitize_undefined attribute.
650
651 2014-06-30 Igor Zamyatin <igor.zamyatin@intel.com>
652
653 PR middle-end/57541
654 * cp-array-notation.c (expand_sec_reduce_builtin):
655 Check that bultin argument is correct.
656 * call.c (build_cxx_call): Check for 0 arguments in builtin call.
657
658 2014-06-28 Jonathan Wakely <jwakely@redhat.com>
659
660 DR 1579
661 PR c++/58051
662 * typeck.c (check_return_expr): Lookup as an rvalue even when the
663 types aren't the same.
664
665 2014-06-27 Jason Merrill <jason@redhat.com>
666
667 PR c++/61433
668 * error.c (dump_template_bindings): Don't tsubst in a clone.
669
670 2014-06-27 Paolo Carlini <paolo.carlini@oracle.com>
671
672 PR c++/61614
673 * semantics.c (finish_compound_literal): Revert r204228.
674
675 2014-06-27 Paolo Carlini <paolo.carlini@oracle.com>
676
677 * parser.c (cp_parser_compound_literal_p): New.
678 (cp_parser_postfix_expression, cp_parser_sizeof_operand): Use it.
679
680 2014-06-26 Jason Merrill <jason@redhat.com>
681
682 * parser.c (cp_parser_for_init_statement): Change range-for error
683 to pedwarn.
684
685 N3994 Ranged-based for-loops: The Next Generation
686 * parser.c (cp_lexer_nth_token_is): New.
687 (cp_parser_for_init_statement): Allow "for (id : init)".
688
689 2014-06-26 Teresa Johnson <tejohnson@google.com>
690
691 * class.c (dump_class_hierarchy): Use saved dump files.
692 (dump_vtable): Ditto.
693 (dump_vtt): Ditto.
694
695 2014-06-26 Adam Butcher <adam@jessamine.co.uk>
696
697 PR c++/61537
698 * parser.c (cp_parser_elaborated_type_specifier): Only consider template
699 parameter lists outside of function parameter scope.
700
701 2014-06-25 Paolo Carlini <paolo.carlini@oracle.com>
702
703 DR 178
704 PR c++/49132
705 * typeck2.c (process_init_constructor_record): Do not complain about
706 uninitialized const members, because within aggregate-initialization,
707 members without explicit initializers are value-initialized.
708
709 2014-06-25 Jakub Jelinek <jakub@redhat.com>
710
711 * semantics.c (finish_omp_clauses): Make sure
712 OMP_CLAUSE_LINEAR_STEP has correct type.
713
714 2014-06-24 Jan Hubicka <hubicka@ucw.cz>
715
716 * class.c (check_methods, create_vtable_ptr, determine_key_method,
717 add_vcall_offset_vtbl_entries_1): Guard VINDEX checks by
718 FUNCTION_DECL check.
719 * cp-tree.h (lang_decl_ns): Add ns_using and ns_users.
720 (DECL_NAMESPACE_USING, DECL_NAMESPACE_USERS): Use lang_decl_ns.
721 (DECL_NAMESPACE_ASSOCIATIONS): Use DECL_INITIAL.
722 (DECL_TEMPLATE_INSTANTIATIONS): Use DECL_SIZE_UNIT.
723
724 2014-06-24 Paolo Carlini <paolo.carlini@oracle.com>
725
726 PR c++/33972
727 * decl.c (grokdeclarator): Do not early check for operator-function-id
728 as non-function.
729
730 2014-06-24 Trevor Saunders <tsaunders@mozilla.com>
731
732 * class.c, semantics.c, tree.c, vtable-class-hierarchy.c:
733 Adjust.
734
735 2014-06-24 Jakub Jelinek <jakub@redhat.com>
736
737 * parser.c (cp_parser_omp_for_loop): For
738 #pragma omp parallel for simd move lastprivate clause from parallel
739 to for rather than simd.
740
741 2014-06-23 Paolo Carlini <paolo.carlini@oracle.com>
742
743 DR 577
744 PR c++/33101
745 * decl.c (grokparms): Accept a single parameter of type 'void'.
746
747 2014-06-20 Jason Merrill <jason@redhat.com>
748
749 PR c++/59296
750 * call.c (add_function_candidate): Avoid special 'this' handling
751 if we have a ref-qualifier.
752
753 PR c++/61556
754 * call.c (build_over_call): Call build_this in template path.
755
756 2014-06-19 Jason Merrill <jason@redhat.com>
757
758 PR c++/59296
759 * call.c (add_function_candidate): Also set LOOKUP_NO_TEMP_BIND.
760
761 2014-06-18 Jason Merrill <jason@redhat.com>
762
763 PR c++/59296
764 * call.c (add_function_candidate): Set LOOKUP_NO_RVAL_BIND for
765 ref-qualifier handling.
766
767 PR c++/61507
768 * pt.c (resolve_overloaded_unification): Preserve
769 ARGUMENT_PACK_EXPLICIT_ARGS.
770
771 2014-06-18 Jakub Jelinek <jakub@redhat.com>
772
773 * cp-gimplify.c (cxx_omp_finish_clause): Add a gimple_seq *
774 argument.
775 * cp-tree.h (cxx_omp_finish_clause): Adjust prototype.
776
777 2014-06-17 Jason Merrill <jason@redhat.com>
778
779 PR c++/60605
780 * pt.c (check_default_tmpl_args): Check DECL_LOCAL_FUNCTION_P.
781
782 2014-06-15 Jason Merrill <jason@redhat.com>
783
784 PR c++/61488
785 * pt.c (check_valid_ptrmem_cst_expr): Fix for template context.
786
787 PR c++/61500
788 * tree.c (lvalue_kind): Handle MEMBER_REF and DOTSTAR_EXPR.
789
790 2014-06-15 Jan Hubicka <hubicka@ucw.cz>
791
792 * decl.c (grokvardecl): Fix pasto in previous patch.
793
794 2014-06-15 Jan Hubicka <hubicka@ucw.cz>
795
796 * decl.c (duplicate_decls): Use set_decl_tls_model.
797 (grokdeclarator): Likewise.
798 * semantics.c (finish_id_expression): Check TLS only for
799 static variables.
800 (finish_omp_threadprivate): Use decl_default_tls_model.
801 * decl2.c (get_guard): Likewise.
802 * call.c (make_temporary_var_for_ref_to_temp): Likewise.
803
804 2014-06-14 Paolo Carlini <paolo.carlini@oracle.com>
805
806 PR c++/33101
807 * decl.c (grokparms): Improve error message about void parameters.
808 * error.c (type_to_string): Fix aka cut off code.
809
810 2014-06-12 Jason Merrill <jason@redhat.com>
811
812 * call.c (convert_arg_to_ellipsis): Use abi_version_crosses.
813 * cvt.c (type_promotes_to): Likewise.
814 * mangle.c (write_type, write_expression): Likewise.
815 (write_name, write_template_arg): Likewise.
816 (mangle_decl): Make alias based on flag_abi_compat_version.
817 Emit -Wabi warning here.
818 (finish_mangling_internal): Not here. Drop warn parm.
819 (finish_mangling_get_identifier, finish_mangling): Adjust.
820 (mangle_type_string, mangle_special_for_type): Adjust.
821 (mangle_ctor_vtbl_for_type, mangle_thunk): Adjust.
822 (mangle_guard_variable, mangle_tls_init_fn): Adjust.
823 (mangle_tls_wrapper_fn, mangle_ref_init_variable): Adjust.
824
825 * call.c (build_operator_new_call): Remove -fabi-version=1 support.
826 * class.c (walk_subobject_offsets, include_empty_classes): Likewise.
827 (layout_nonempty_base_or_field, end_of_class): Likewise.
828 (layout_empty_base, build_base_field, layout_class_type): Likewise.
829 (is_empty_class, add_vcall_offset_vtbl_entries_1): Likewise.
830 (layout_virtual_bases): Likewise.
831 * decl.c (compute_array_index_type): Likewise.
832 * mangle.c (write_mangled_name, write_prefix): Likewise.
833 (write_template_prefix, write_integer_cst, write_expression): Likewise.
834 (write_template_arg, write_array_type): Likewise.
835 * method.c (lazily_declare_fn): Likewise.
836 * rtti.c (get_pseudo_ti_index): Likewise.
837 * typeck.c (comp_array_types): Likewise.
838
839 2014-06-11 Jan Hubicka <hubicka@ucw.cz>
840
841 * vtable-class-hierarchy.c: Update handling for section names
842 that are no longer trees.
843 * decl.c (duplicate_decls): Likewise.
844
845 2014-06-11 Paolo Carlini <paolo.carlini@oracle.com>
846
847 PR c++/19200
848 * parser.c (cp_parser_init_declarator): Actually pass friend_p
849 to cp_parser_declarator.
850
851 2014-06-11 Paolo Carlini <paolo.carlini@oracle.com>
852
853 PR c++/60265
854 * parser.c (cp_parser_using_declaration): Handle unscoped enums.
855 * name-lookup.c (validate_nonmember_using_decl): Adjust error
856 message.
857
858 2014-06-11 Paolo Carlini <paolo.carlini@oracle.com>
859
860 PR c++/19200
861 * parser.c (cp_parser_declarator): Add bool parameter.
862 (cp_parser_direct_declarator): Likewise, use it.
863 (cp_parser_member_declaration): Pass friend_p to cp_parser_declarator.
864 (cp_parser_condition, cp_parser_explicit_instantiation,
865 cp_parser_init_declarator, cp_parser_type_id_1,
866 cp_parser_parameter_declaration, cp_parser_exception_declaration,
867 cp_parser_cache_defarg, cp_parser_objc_class_ivars,
868 cp_parser_objc_struct_declaration, cp_parser_omp_for_loop_init):
869 Adjust.
870 * decl.c (grokdeclarator): Fix handling of friend declared in
871 namespace scope (g++.dg/parse/friend10.C).
872
873 2014-06-10 Jan Hubicka <hubicka@ucw.cz>
874
875 * vtable-class-hierarchy.c: Use symtab_get_node (var_decl)
876 ->implicit_section.
877 * optimize.c (cdtor_comdat_group): Fix handling of aliases.
878 (maybe_clone_body): Move symbol across comdat groups.
879 * method.c (use_thunk): Copy implicit section flag.
880
881 2014-06-09 Paolo Carlini <paolo.carlini@oracle.com>
882
883 PR c++/22556
884 * name-lookup.c (pushdecl_maybe_friend_1): Use comptypes.
885
886 2014-06-07 Jan Hubicka <hubicka@ucw.cz>
887
888 * method.c (use_thunk): Use set_decl_section_name.
889 * optimize.c (maybe_clone_body): Use set_decl_section_name.
890 * decl.c (duplicate_decls): Likewise.
891 * vtable-class-hierarchy.c: Likewise.
892
893 2014-06-06 Paolo Carlini <paolo.carlini@oracle.com>
894
895 PR c++/60184
896 * class.c (check_field_decls): In C++11 mode do not reject
897 static data members and reference-type members in unions.
898
899 2014-06-05 Jason Merrill <jason@redhat.com>
900
901 PR c++/43453
902 * decl.c (check_initializer): Collapse a TREE_LIST here.
903 * typeck2.c (store_init_value): Not here.
904
905 2014-06-05 Richard Biener <rguenther@suse.de>
906 Paolo Carlini <paolo.carlini@oracle.com>
907
908 PR c++/56961
909 * cp-gimplify.c (cp_gimplify_expr, [MODIFY_EXPR]): Rework
910 handling of empty classes.
911
912 2014-06-04 Jason Merrill <jason@redhat.com>
913
914 * parser.c (cp_parser_diagnose_invalid_type_name): Give helpful note
915 for noexcept and thread_local, too.
916
917 PR c++/61343
918 * decl.c (check_initializer): Maybe clear
919 DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P.
920
921 2014-06-05 Richard Biener <rguenther@suse.de>
922
923 PR c++/61004
924 * typeck.c (cp_build_indirect_ref): Do not emit strict-aliasing
925 warnings for accessing empty classes.
926
927 2014-06-05 Marek Polacek <polacek@redhat.com>
928
929 PR c/49706
930 * parser.c (cp_parser_binary_expression): Warn when logical not is
931 used on the left hand side operand of a comparison.
932
933 2014-06-04 Paolo Carlini <paolo.carlini@oracle.com>
934
935 PR c++/43453
936 * typeck.c (cp_build_modify_expr): Handle array of characters
937 initialized by a string literal.
938 * decl.c (check_initializer): Handle parenthesized string literal
939 as initializer.
940 * typeck2.c (store_init_value): Remove redundant check.
941
942 2014-06-04 Jason Merrill <jason@redhat.com>
943
944 PR c++/51253
945 PR c++/61382
946 * cp-gimplify.c (cp_gimplify_expr): Handle CALL_EXPR_LIST_INIT_P here.
947 * semantics.c (simplify_aggr_init_expr): Not here, just copy it.
948
949 2014-06-04 Igor Zamyatin <igor.zamyatin@intel.com>
950
951 PR c/58942
952 * cp-array-notation.c (expand_sec_reduce_builtin): Handle the case
953 with a pointer.
954
955 2014-06-03 Paolo Carlini <paolo.carlini@oracle.com>
956
957 DR 1423
958 PR c++/52174
959 * call.c (standard_conversion): Convert nullptr to bool only
960 in case of direct-initialization.
961 (convert_like_real): Provide informative error message.
962
963 2014-06-03 Marek Polacek <polacek@redhat.com>
964
965 PR c/60439
966 * semantics.c (finish_switch_cond): Warn if switch condition has
967 boolean value.
968
969 2014-06-03 Jason Merrill <jason@redhat.com>
970
971 PR c++/60992
972 * pt.c (tsubst_copy) [VAR_DECL]: Try lookup first. Add a new
973 variable to local_specializations.
974
975 PR c++/60848
976 * call.c (is_std_init_list): Check CLASSTYPE_TEMPLATE_INFO.
977
978 2014-06-02 Jason Merrill <jason@redhat.com>
979
980 PR c++/61046
981 * decl.c (reshape_init_class): Handle un-folded
982 constant-expressions.
983
984 PR c++/61134
985 * pt.c (pack_deducible_p): Handle canonicalization.
986
987 2014-06-02 Paolo Carlini <paolo.carlini@oracle.com>
988
989 * pt.c (tsubst_function_type): Initialize arg_types.
990
991 2014-06-02 Siva Chandra Reddy <sivachandra@google.com>
992
993 PR debug/57519
994 * class.c (handle_using_decl): Pass the correct scope to
995 cp_emit_debug_info_for_using.
996
997 2014-06-02 Ville Voutilainen <ville.voutilainen@gmail.com>
998
999 PR c++/59483
1000 PR c++/61148
1001 * search.c (accessible_p): Use current_nonlambda_class_type.
1002 * semantics.c (check_accessibility_of_qualified_id): Likewise.
1003
1004 2014-06-02 Andrew MacLeod <amacleod@redhat.com>
1005
1006 * decl.c: Include builtins.h.
1007 * semantics.c: Likewise.
1008
1009 2014-05-31 Paolo Carlini <paolo.carlini@oracle.com>
1010
1011 DR 1227
1012 PR c++/57543
1013 * cp-tree.h (TYPE_HAS_LATE_RETURN_TYPE): Add.
1014 * pt.c (tsubst_function_type): Inject the this parameter; do the
1015 substitutions in the order mandated by the DR.
1016 (copy_default_args_to_explicit_spec): Copy TYPE_HAS_LATE_RETURN_TYPE.
1017 * decl.c (grokdeclarator): Maybe set TYPE_HAS_LATE_RETURN_TYPE.
1018 (static_fn_type): Copy it.
1019 * decl2.c (build_memfn_type, change_return_type,
1020 cp_reconstruct_complex_type): Likewise.
1021 * parser.c (cp_parser_lambda_declarator_opt): Likewise.
1022 * tree.c (strip_typedefs): Likewise.
1023 * typeck.c (merge_types): Likewise.
1024
1025 2014-05-30 Jason Merrill <jason@redhat.com>
1026
1027 PR c++/56947
1028 * pt.c (instantiate_decl): Check that defer_ok is not set for
1029 local class members.
1030
1031 PR c++/60992
1032 * pt.c (tsubst_init): Split out from...
1033 (tsubst_expr) [DECL_EXPR]: Here.
1034 (tsubst_copy) [VAR_DECL]: Use it.
1035 * semantics.c (finish_id_expression): Return the decl for static/const.
1036
1037 2014-05-28 Jason Merrill <jason@redhat.com>
1038
1039 PR c++/47202
1040 * decl.c (cxx_comdat_group): Return a decl.
1041 * optimize.c (cdtor_comdat_group): Get its DECL_ASSEMBLER_NAME.
1042
1043 * pt.c (tsubst) [ARRAY_TYPE]: Check for array of array of unknown
1044 bound.
1045
1046 PR c++/61242
1047 * call.c (build_aggr_conv): Ignore passed in flags.
1048 (build_array_conv, build_complex_conv): Likewise.
1049
1050 2014-05-23 Jan Hubicka <hubicka@ucw.cz>
1051
1052 * optimize.c (maybe_thunk_body): Use set_comdat_group.
1053 (maybe_clone_body): Likewise.
1054 * decl.c (duplicate_decls): Update code duplicating comdat group;
1055 do not copy symtab pointer; before freeing newdecl remove it
1056 from symtab.
1057 * decl2.c (constrain_visibility): Use set_comdat_group.
1058
1059 2014-05-23 Jan Hubicka <hubicka@ucw.cz>
1060
1061 * rtti.c: Include tm_p.h
1062 (emit_tinfo_decl): Force RTTI data to be aligned to required
1063 ABI alignment only.
1064
1065 2014-05-23 Jan Hubicka <hubicka@ucw.cz>
1066
1067 * class.c (build_vtable): Align vtables to TARGET_VTABLE_ENTRY_ALIGN
1068 ignoring other target adjustments.
1069
1070 2014-05-23 Thomas Schwinge <thomas@codesourcery.com>
1071
1072 * semantics.c (finish_omp_clauses): Remove duplicated variable
1073 initialization.
1074
1075 * parser.c (cp_parser_omp_target): Return bool values.
1076
1077 2014-05-22 Paolo Carlini <paolo.carlini@oracle.com>
1078
1079 PR c++/61088
1080 * lambda.c (add_capture): Enforce that capture by value requires
1081 complete type.
1082 * typeck2.c (cxx_incomplete_type_inform): Early return if
1083 TYPE_MAIN_DECL is null.
1084
1085 2014-05-21 Jonathan Wakely <jwakely@redhat.com>
1086
1087 PR c/61271
1088 * cp-array-notation.c (cilkplus_an_triplet_types_ok_p): Fix condition.
1089
1090 2014-05-21 Ville Voutilainen <ville.voutilainen@gmail.com>
1091
1092 PR c++/61133
1093 * lambda.c (build_capture_proxy, add_capture): Treat normal
1094 captures and init-captures identically.
1095
1096 2014-05-21 Mark Wielaard <mjw@redhat.com>
1097
1098 PR debug/16063
1099 * cp-lang.c (cxx_enum_underlying_base_type): New function.
1100 (LANG_HOOKS_ENUM_UNDERLYING_BASE_TYPE): Define.
1101
1102 2014-05-21 Richard Sandiford <rsandifo@linux.vnet.ibm.com>
1103
1104 * cvt.c (convert_to_void): Use void_node instead of void_zero_node.
1105 * cp-array-notation.c (replace_invariant_exprs): Likewise.
1106 (expand_array_notation): Handle VOID_CST.
1107 * error.c (dump_expr): Likewise.
1108 * cxx-pretty-print.c (cxx_pretty_printer::primary_expression)
1109 (cxx_pretty_printer::expression): Likewise.
1110 (pp_cxx_new_expression): Use void_node instead of void_zero_node.
1111 * decl.c (register_dtor_fn): Likewise.
1112 * init.c (build_raw_new_expr, build_new_1, build_vec_init)
1113 (build_delete, push_base_cleanups): Likewise.
1114 * mangle.c (write_expression): Likewise.
1115 * semantics.c (finish_break_stmt, empty_expr_stmt_p): Likewise.
1116 * pt.c (tsubst_decl, tsubst_copy_and_build): Likewise.
1117 (tsubst, tsubst_copy, build_non_dependent_expr): Handle VOID_CST.
1118 * tree.c (cp_tree_equal): Likewise.
1119 (build_dummy_object, is_dummy_object, stabilize_expr): Use void_node
1120 instead of void_zero_node.
1121 * typeck.c (check_return_expr): Likewise.
1122 * typeck2.c (build_functional_cast): Likewise.
1123
1124 2014-05-21 Igor Zamyatin <igor.zamyatin@intel.com>
1125
1126 PR c/60189
1127 * parser.c (cp_parser_postfix_expression): Move handling of cilk_sync
1128 from here to...
1129 (cp_parser_statement): ...here. Make sure only semicolon can go after
1130 Cilk_sync.
1131
1132 2014-05-20 Paolo Carlini <paolo.carlini@oracle.com>
1133
1134 PR c++/58753
1135 PR c++/58930
1136 PR c++/58704
1137 * typeck2.c (digest_nsdmi_init): New.
1138 * parser.c (cp_parser_late_parse_one_default_arg): Use it.
1139 * init.c (get_nsdmi): Likewise.
1140 * cp-tree.h (digest_nsdmi_init): Declare.
1141
1142 2014-05-20 Jason Merrill <jason@redhat.com>
1143
1144 * typeck.c (get_member_function_from_ptrfunc): Don't try to look
1145 up a virtual function in a dummy object.
1146
1147 2014-05-20 Paolo Carlini <paolo.carlini@oracle.com>
1148
1149 PR c++/60373
1150 * decl.c (duplicate_decls): Replace pair of warning_at with
1151 warning_at + inform.
1152 (maybe_commonize_var): Likewise.
1153
1154 2014-05-20 Richard Sandiford <rsandifo@linux.vnet.ibm.com>
1155
1156 PR bootstrap/61210
1157 * pt.c (tsubst_copy, tsubst_omp_for_iterator, tsubst_expr)
1158 (tsubst_copy_and_build): Perform recursive substitutions in a
1159 deterministic order.
1160
1161 2014-05-20 Paolo Carlini <paolo.carlini@oracle.com>
1162
1163 PR c++/58664
1164 * typeck2.c (cxx_incomplete_type_inform): New.
1165 (cxx_incomplete_type_diagnostic): Use it.
1166 * decl.c (grokdeclarator): Check the element type of an
1167 incomplete array type; call the above.
1168 * cp-tree.h (cxx_incomplete_type_inform): Declare.
1169
1170 2014-05-19 Jason Merrill <jason@redhat.com>
1171
1172 PR c++/58761
1173 * pt.c (tsubst_copy): Don't check at_function_scope_p.
1174 (instantiate_class_template_1): Don't push_to_top_level in an nsdmi.
1175
1176 2014-05-19 Paolo Carlini <paolo.carlini@oracle.com>
1177
1178 * typeck2.c (cxx_incomplete_type_diagnostic): Use inform.
1179 * parser.c (cp_parser_enum_specifier): Likewise.
1180
1181 2014-05-17 Trevor Saunders <tsaunders@mozilla.com>
1182
1183 * class.c (sorted_fields_type_new): Adjust.
1184 * cp-cilkplus.c (cilk_install_body_with_frame_cleanup): Likewise.
1185 * cp-objcp-common.c (decl_shadowed_for_var_insert): Likewise.
1186 * cp-tree.h: Remove usage of variable_size gty attribute.
1187 * decl.c (make_label_decl): Adjust.
1188 (check_goto): Likewise.
1189 (start_preparsed_function): Likewise.
1190 (save_function_data): Likewise.
1191 * lex.c (init_reswords): Likewise.
1192 (retrofit_lang_decl): Likewise.
1193 (cxx_dup_lang_specific_decl): Likewise.
1194 (copy_lang_type): Likewise.
1195 (cxx_make_type): Likewise.
1196 * name-lookup.c (binding_entry_make): Likewise.
1197 (binding_table_construct): Likewise.
1198 (binding_table_new): Likewise.
1199 (cxx_binding_make): Likewise.
1200 (pushdecl_maybe_friend_1): Likewise.
1201 (begin_scope): Likewise.
1202 (push_to_top_level): Likewise.
1203 * parser.c (cp_lexer_alloc): Likewise.
1204 (cp_lexer_new_from_tokens): Likewise.
1205 (cp_token_cache_new): Likewise.
1206 (cp_parser_context_new): Likewise.
1207 (cp_parser_new): Likewise.
1208 (cp_parser_nested_name_specifier_opt): Likewise.
1209 (cp_parser_template_id): Likewise.
1210 * pt.c (maybe_process_partial_specialization): Likewise.
1211 (register_specialization): Likewise.
1212 (add_pending_template): Likewise.
1213 (lookup_template_class_1): Likewise.
1214 (push_tinst_level): Likewise.
1215 * semantics.c (register_constexpr_fundef): Likewise.
1216 (cxx_eval_call_expression): Likewise.
1217 * typeck2.c (abstract_virtuals_error_sfinae): Likewise.
1218
1219 2014-05-16 Paolo Carlini <paolo.carlini@oracle.com>
1220
1221 PR c++/51640
1222 * parser.c (cp_parser_diagnose_invalid_type_name): Early return
1223 when cp_parser_lookup_name sets ambiguous_decls.
1224
1225 2014-05-15 Jason Merrill <jason@redhat.com>
1226
1227 * call.c (print_conversion_rejection): Use loc consistently.
1228
1229 2014-05-14 Paolo Carlini <paolo.carlini@oracle.com>
1230
1231 * cp-tree.h (DIRECT_LIST_INIT_P): Add.
1232 * call.c (convert_like_real, build_new_method_call_1): Use it.
1233 * decl2.c (grokfield): Likewise.
1234 * init.c (perform_member_init, build_aggr_init, expand_default_init,
1235 build_new_1): Likewise.
1236 * mangle.c (write_expression): Likewise.
1237 * parser.c (cp_parser_late_parse_one_default_arg): Likewise.
1238
1239 2014-05-14 Jason Merrill <jason@redhat.com>
1240
1241 PR c++/20332
1242 PR c++/21631
1243 * call.c (reference_binding): Treat lvalue/rvalue mismatch and
1244 dropped cv-quals as a bad conversion.
1245 (convert_like_real) [ck_ref_bind]: Explain them.
1246 (compare_ics): Check badness before stripping reference
1247 bindings. Handle comparing bad reference bindings.
1248 * typeck.c (comp_cv_qualification): Add overload that just takes
1249 integers.
1250 * cp-tree.h: Declare it.
1251
1252 * call.c (struct conversion_info): Rename 'from_type' to 'from'.
1253 (arg_conversion_rejection, bad_arg_conversion_rejection)
1254 (explicit_conversion_rejection, template_conversion_rejection): Adjust.
1255 (add_function_candidate): Pass actual argument, rather than type, to
1256 bad_arg_conversion_rejection.
1257 (print_conversion_rejection): Explain what's wrong with the conversion.
1258 (print_z_candidates): Say "candidate:" before each candidate.
1259 (splice_viable): Be strict if we see a viable or template candidate.
1260 (build_user_type_conversion_1): Pass false to strict parameter.
1261 (perform_overload_resolution, build_conditional_expr_1): Likewise.
1262 (build_new_op_1, build_new_method_call_1): Likewise.
1263 (build_op_call_1): Pass true to strict parameter.
1264
1265 2014-05-13 Jason Merrill <jason@redhat.com>
1266
1267 * call.c (print_error_for_call_failure): Say "no match" rather
1268 than "ambiguous" if there were no strict matches.
1269 (build_new_method_call_1): Likewise.
1270
1271 PR c++/61151
1272 * semantics.c (is_this_parameter): Allow capture proxies too.
1273
1274 2014-05-12 Jason Merrill <jason@redhat.com>
1275
1276 * call.c (maybe_print_user_conv_context): New.
1277 (convert_like_real): Use it. Print call context for bad
1278 user-defined conversion.
1279 (build_over_call): Print call context for bad 'this' conversion.
1280
1281 * call.c (convert_like_real): Use inform for identifying the
1282 declaration point.
1283
1284 2014-05-12 Paolo Carlini <paolo.carlini@oracle.com>
1285
1286 * cvt.c (cp_convert_to_pointer): Don't call error_at if
1287 complain & tf_error is false.
1288
1289 * decl.c (make_unbound_class_template): Prefer inform for
1290 "declared here"-type message.
1291
1292 2014-05-09 Momchil Velikov <momchil.velikov@gmail.com>
1293
1294 PR c++/60463
1295 PR c++/60755
1296 * lambda.c (lambda_expr_this_capture): Add new parameter
1297 add_capture_p controlling whether the functions will try to
1298 capture 'this' via the default capture.
1299 (maybe_resolve_dummy): Likewise.
1300 * cp-tree.h: Adjust prototypes.
1301 * call.c, semantics.c: Change callers of these functions.
1302 * call.c (build_new_method_call_1): Use the actual 'this' that
1303 would be potentially captured for the overload resolution, instead
1304 of the dummy object.
1305
1306 2014-05-09 Paolo Carlini <paolo.carlini@oracle.com>
1307
1308 * pt.c (convert_nontype_argument_function): Add tsubst_flags_t
1309 parameter.
1310 (convert_nontype_argument): Adjust calls.
1311 (coerce_template_parameter_pack): Add missing complain & tf_error
1312 check.
1313
1314 2014-05-09 Jason Merrill <jason@redhat.com>
1315
1316 DR 587
1317 PR c++/51317
1318 * call.c (build_conditional_expr_1, conditional_conversion): Handle
1319 non-class lvalues and xvalues that differ only in cv-qualifiers.
1320
1321 DR 5
1322 PR c++/60019
1323 * call.c (build_user_type_conversion_1): The copy-init temporary
1324 is cv-unqualified.
1325
1326 PR c++/58714
1327 * tree.c (stabilize_expr): A stabilized prvalue is an xvalue.
1328
1329 PR c++/54348
1330 * call.c (build_conditional_expr_1): If overload resolution finds
1331 no match, just say "different types".
1332
1333 PR c++/32019
1334 * call.c (build_conditional_expr_1): Improve ambiguity diagnostic.
1335
1336 PR c++/22434
1337 * call.c (build_conditional_expr_1): Don't try to pool cv-quals
1338 if we didn't find a conversion.
1339 Don't accept a bad conversion too early.
1340
1341 2014-05-08 Paolo Carlini <paolo.carlini@oracle.com>
1342
1343 PR c++/13981
1344 * typeck.c (convert_for_assignment): Provide an inform for pointers
1345 to incomplete class types.
1346
1347 2014-05-07 Paolo Carlini <paolo.carlini@oracle.com>
1348
1349 PR c++/61083
1350 * pt.c (convert_nontype_argument): Protect all the error calls
1351 with complain & tf_error.
1352
1353 2014-05-07 Paolo Carlini <paolo.carlini@oracle.com>
1354
1355 PR c++/61080
1356 * pt.c (instantiate_decl): Avoid generating the body of a
1357 deleted function.
1358
1359 2014-05-06 Paolo Carlini <paolo.carlini@oracle.com>
1360
1361 PR c++/60999
1362 * pt.c (maybe_begin_member_template_processing): Use
1363 uses_template_parms.
1364
1365 2014-05-06 Kenneth Zadeck <zadeck@naturalbridge.com>
1366 Mike Stump <mikestump@comcast.net>
1367 Richard Sandiford <rdsandiford@googlemail.com>
1368
1369 * call.c: Include wide-int.h.
1370 (type_passed_as): Use tree_int_cst_lt instead of INT_CST_LT_UNSIGNED.
1371 (convert_for_arg_passing): Likewise.
1372 * class.c: Include wide-int.h.
1373 (walk_subobject_offsets): Use tree_int_cst_lt instead of INT_CST_LT.
1374 (end_of_class): Use tree_int_cst_lt instead of INT_CST_LT_UNSIGNED.
1375 (include_empty_classes): Likewise
1376 (layout_class_type): Use tree_int_cst_lt instead of INT_CST_LT.
1377 * cvt.c: Include wide-int.h.
1378 (ignore_overflows): Use wide_int_to_tree.
1379 * decl.c: Include wide-int.h.
1380 (check_array_designated_initializer): Use wide-int interfaces.
1381 (compute_array_index_type): Use tree_int_cst_lt instead of INT_CST_LT.
1382 (finish_enum_value_list): Use signop.
1383 (build_enumerator): Use wide-int interfaces.
1384 * init.c: Include wide-int.h.
1385 (build_new_1): Use wide-int interfaces.
1386 * mangle.c: Include wide-int.h.
1387 (write_integer_cst): Use wide-int interfaces.
1388 (write_array_type): Likewise.
1389 * tree.c: Include wide-int.h.
1390 (cp_tree_equal): Use tree_int_cst_equal.
1391 * typeck2.c: Include wide-int.h.
1392 (process_init_constructor_array): Use wide-int interfaces.
1393
1394 2014-05-03 Paolo Carlini <paolo.carlini@oracle.com>
1395
1396 PR c++/58582
1397 * decl.c (grokfndecl): Check duplicate_decls return value for
1398 error_mark_node.
1399 * pt.c (instantiate_decl): A deleted function is defined.
1400
1401 2014-05-02 Jason Merrill <jason@redhat.com>
1402
1403 * decl2.c (vague_linkage_p): Local statics have vague linkage.
1404
1405 PR c++/60992
1406 * lambda.c (lambda_capture_field_type): Wrap anything dependent
1407 other than 'this'.
1408 (add_capture): Check for VLA before calling it.
1409 * semantics.c (is_this_parameter): Accept any 'this' parameter, not
1410 just the current one. Make non-static.
1411 * cp-tree.h: Declare it.
1412 * pt.c (tsubst_copy) [VAR_DECL]: Also build a new VAR_DECL if
1413 the operand was static or constant.
1414
1415 2014-05-02 Marek Polacek <polacek@redhat.com>
1416
1417 * typeck.c (maybe_warn_about_returning_address_of_local): Separate
1418 warning_at calls.
1419
1420 2014-05-01 Marek Polacek <polacek@redhat.com>
1421
1422 PR c/43395
1423 * typeck.c (maybe_warn_about_returning_address_of_local): Distinguish
1424 between label and variable when warning about returning local address.
1425
1426 2014-04-30 Jason Merrill <jason@redhat.com>
1427
1428 PR c++/60980
1429 * init.c (build_value_init): Don't try to call an array constructor.
1430
1431 PR c++/60951
1432 * typeck2.c (massage_init_elt): Use maybe_constant_init.
1433
1434 2014-04-30 Marek Polacek <polacek@redhat.com>
1435
1436 * typeck.c (cp_build_binary_op): Call ubsan_instrument_division
1437 even when SANITIZE_FLOAT_DIVIDE is on. Set doing_div_or_mod even
1438 for non-integer types.
1439
1440 2014-04-29 Jason Merrill <jason@redhat.com>
1441
1442 DR 1351
1443 Represent the unevaluated exception specification of an implicitly
1444 declared or deleted function with a simple placeholder, not a list
1445 of functions.
1446 * cp-tree.h (UNEVALUATED_NOEXCEPT_SPEC_P): New.
1447 * except.c (unevaluated_noexcept_spec): New.
1448 * class.c (deduce_noexcept_on_destructor): Use it.
1449 * decl.c (check_redeclaration_exception_specification): Call
1450 maybe_instantiate_noexcept.
1451 (duplicate_decls): Call it before merge_types.
1452 (start_preparsed_function): Call maybe_instantiate_noexcept.
1453 * decl2.c (mark_used): Call maybe_instantiate_noexcept earlier.
1454 * init.c (get_nsdmi): Factor out of perform_member_init.
1455 * method.c (process_subob_fn): Call maybe_instantiate_noexcept.
1456 (walk_field_subobs): Consider NSDMI for EH spec.
1457 (get_defaulted_eh_spec): New.
1458 (implicitly_declare_fn): Use unevaluated_noexcept_spec.
1459 (defaulted_late_check): Defer EH checking in non-template classes.
1460 (after_nsdmi_defaulted_late_checks): New.
1461 * parser.c (cp_parser_class_specifier_1): Use it.
1462 (unparsed_classes): New macro.
1463 * parser.h (cp_unparsed_functions_entry_d): Add classes field.
1464 * pt.c (maybe_instantiate_noexcept): Use get_defaulted_eh_spec.
1465 Remove list-of-functions handling.
1466 * typeck2.c (merge_exception_specifiers): Remove list-of-functions
1467 handling and FN parameter.
1468 * typeck.c (merge_types): Adjust.
1469
1470 2014-04-28 Paolo Carlini <paolo.carlini@oracle.com>
1471
1472 PR c++/59120
1473 * parser.c (cp_parser_alias_declaration): Check return value of
1474 cp_parser_require.
1475
1476 2014-04-24 Jakub Jelinek <jakub@redhat.com>
1477
1478 * parser.c (cp_parser_omp_atomic): Allow seq_cst before
1479 atomic-clause, allow comma in between atomic-clause and
1480 seq_cst.
1481
1482 2014-04-24 Marc Glisse <marc.glisse@inria.fr>
1483
1484 PR libstdc++/43622
1485 * rtti.c (emit_support_tinfos): Do not iterate on
1486 registered_builtin_types (partial revert).
1487
1488 2014-04-23 Dinar Temirbulatov <dtemirbulatov@gmail.com>
1489
1490 PR c++/57958
1491 * semantics.c (apply_deduced_return_type): Complete non-void type
1492 before estimating whether the type is aggregate.
1493
1494 2014-04-22 Marc Glisse <marc.glisse@inria.fr>
1495
1496 PR libstdc++/43622
1497 * rtti.c (emit_support_tinfo_1): New function, extracted from
1498 emit_support_tinfos.
1499 (emit_support_tinfos): Call it and iterate on registered_builtin_types.
1500
1501 2014-04-22 Jakub Jelinek <jakub@redhat.com>
1502
1503 PR c/59073
1504 * parser.c (cp_parser_omp_parallel): If cp_parser_omp_for
1505 fails, don't set OM_PARALLEL_COMBINED and return NULL.
1506
1507 2014-04-18 Jason Merrill <jason@redhat.com>
1508
1509 DR 1571
1510 * call.c (reference_binding): Recurse on user-defined conversion.
1511
1512 PR c++/60872
1513 * call.c (standard_conversion): Don't try to apply restrict to void.
1514
1515 2014-04-16 Marc Glisse <marc.glisse@inria.fr>
1516
1517 * decl.c (reshape_init_r): Handle a single element of vector type.
1518
1519 2014-04-16 Patrick Palka <patrick@parcs.ath.cx>
1520
1521 PR c++/60765
1522 * decl2.c (cplus_decl_attributes): Handle
1523 pointer-to-member-function declarations.
1524
1525 2014-04-16 Patrick Palka <patrick@parcs.ath.cx>
1526
1527 PR c++/60764
1528 * call.c (build_user_type_coversion): Use build_dummy_object
1529 to create the placeholder object for a constructor method call.
1530 (build_special_member_call): Likewise.
1531 (build_over_call): Check for the placeholder object with
1532 is_dummy_object.
1533 (build_new_method_call_1): Likewise. Don't attempt to resolve
1534 a dummy object for a constructor method call.
1535
1536 2014-04-16 Paul Pluzhnikov <ppluzhnikov@google.com>
1537
1538 PR c++/59295
1539 * friend.c (add_friend, make_friend_class): Move repeated friend
1540 warning under Wredundant_decls.
1541
1542 2014-04-15 Paolo Carlini <paolo.carlini@oracle.com>
1543
1544 * decl.c (duplicate_decls): Remove redundant TYPE_NAME use.
1545 * name-lookup.c (pushdecl_maybe_friend_1): Likewise.
1546 (do_class_using_decl): Likewise.
1547 * mangle.c (dump_substitution_candidates): Use TYPE_NAME_STRING.
1548
1549 2014-04-15 Jakub Jelinek <jakub@redhat.com>
1550
1551 PR plugins/59335
1552 * Make-lang.h (CP_PLUGIN_HEADERS): Add type-utils.h.
1553
1554 2014-04-14 Paolo Carlini <paolo.carlini@oracle.com>
1555
1556 * cp-tree.h (TYPE_IDENTIFIER): Remove declaration.
1557
1558 2014-04-14 Paolo Carlini <paolo.carlini@oracle.com>
1559
1560 * pt.c (mark_template_parm): Use template_parm_level_and_index.
1561
1562 2014-04-11 Jason Merrill <jason@redhat.com>
1563
1564 * parser.h (struct cp_token): Rename ambiguous_p to error_reported.
1565 * parser.c: Adjust.
1566 (cp_lexer_get_preprocessor_token): Always clear it.
1567 (cp_parser_lambda_expression): Use it to avoid duplicate diagnostics.
1568
1569 DR 1467
1570 PR c++/51747
1571 * decl.c (reshape_init_r): Handle a single element of class type.
1572
1573 DR 1338
1574 * decl.c (cxx_init_decl_processing): Set DECL_IS_MALLOC on
1575 built-in operator new.
1576
1577 2014-04-11 Paolo Carlini <paolo.carlini@oracle.com>
1578
1579 PR c++/58600
1580 * name-lookup.c (parse_using_directive): Return early if the
1581 attribs argument is error_mark_node; use get_attribute_name.
1582
1583 2014-04-11 Jason Merrill <jason@redhat.com>
1584
1585 DR 1030
1586 PR c++/51253
1587 * cp-tree.h (CALL_EXPR_LIST_INIT_P): New.
1588 * call.c (struct z_candidate): Add flags field.
1589 (add_candidate): Add flags parm.
1590 (add_function_candidate, add_conv_candidate, build_builtin_candidate)
1591 (add_template_candidate_real): Pass it.
1592 (build_over_call): Set CALL_EXPR_LIST_INIT_P.
1593 * tree.c (build_aggr_init_expr): Copy it.
1594 * semantics.c (simplify_aggr_init_expr): Preevaluate args if it's set.
1595
1596 2014-04-10 Richard Biener <rguenther@suse.de>
1597 Jakub Jelinek <jakub@redhat.com>
1598
1599 PR ipa/60761
1600 * error.c (dump_decl) <case FUNCTION_DECL>: If
1601 DECL_LANG_SPECIFIC is NULL, but DECL_ABSTRACT_ORIGIN is not,
1602 recurse on DECL_ABSTRACT_ORIGIN instead of printing
1603 <built-in>.
1604
1605 2014-04-09 Fabien Chêne <fabien@gcc.gnu.org>
1606
1607 * pt.c (check_template_variable): Check for the return of pedwarn
1608 before emitting a note.
1609 * parser.c (cp_parser_lambda_introducer): Likewise.
1610
1611 2014-04-08 Paolo Carlini <paolo.carlini@oracle.com>
1612
1613 PR c++/59115
1614 * pt.c (process_template_parm): For an invalid non-type parameter
1615 only set TREE_TYPE to error_mark_node.
1616 (push_inline_template_parms_recursive, comp_template_parms,
1617 redeclare_class_template, coerce_template_template_parm,
1618 coerce_template_template_parms, unify): Use error_operand_p.
1619
1620 2014-04-08 Nathan Sidwell <nathan@codesourcery.com>
1621
1622 * class.c (check_bases_and_members): Warn about non-virtual dtors
1623 in public bases only. Check warn_ecpp before complaining about
1624 non-polymorphic bases.
1625
1626 2014-04-04 Fabien Chêne <fabien@gcc.gnu.org>
1627
1628 * decl.c (duplicate_decls): Check for the return of warning_at
1629 before emitting a note.
1630 (warn_misplaced_attr_for_class_type): Likewise.
1631 (check_tag_decl): Likewise.
1632
1633 2014-04-04 Paolo Carlini <paolo.carlini@oracle.com>
1634
1635 PR c++/58207
1636 * semantics.c (sort_constexpr_mem_initializers): Robustify loop.
1637
1638 2014-04-04 Patrick Palka <patrick@parcs.ath.cx>
1639
1640 PR c++/44613
1641 * semantics.c (add_stmt): Set STATEMENT_LIST_HAS_LABEL.
1642 * decl.c (cp_finish_decl): Create a new BIND_EXPR before
1643 instantiating a variable-sized type.
1644
1645 PR c++/21113
1646 * decl.c (decl_jump_unsafe): Consider variably-modified decls.
1647
1648 2014-04-04 Fabien Chêne <fabien@gcc.gnu.org>
1649
1650 * class.c (find_abi_tags_r): Check for the return of warning
1651 before emitting a note.
1652 (one_inherited_ctor): Likewise.
1653
1654 2014-04-04 Fabien Chêne <fabien@gcc.gnu.org>
1655
1656 * decl.c (duplicate_decls): Check for the return of permerror
1657 before emitting a note.
1658
1659 2014-04-03 Nathan Sidwell <nathan@codesourcery.com>
1660
1661 * class.c (accessible_nvdtor_p): New.
1662 (check_bases): Don't check base destructor here ...
1663 (check_bases_and_members): ... check them here. Trigger on
1664 Wnon-virtual-dtor flag.
1665 (finish_struct_1): Use accessible_nvdtor_p.
1666
1667 2014-04-01 Jason Merrill <jason@redhat.com>
1668
1669 * pt.c (process_partial_specialization): Say "not deducible"
1670 rather than "not used". Use inform.
1671
1672 PR c++/60374
1673 * pt.c (coerce_template_parms): Check that the pack expansion
1674 pattern works with the first matching parameter.
1675
1676 2014-04-01 Fabien Chêne <fabien@gcc.gnu.org>
1677
1678 * init.c (perform_member_init): Homogenize uninitialized
1679 diagnostics.
1680
1681 2014-04-01 Jason Merrill <jason@redhat.com>
1682
1683 PR c++/60708
1684 * call.c (build_array_conv): Call complete_type.
1685
1686 PR c++/60713
1687 * typeck2.c (PICFLAG_SIDE_EFFECTS): New.
1688 (picflag_from_initializer): Return it.
1689 (process_init_constructor): Handle it.
1690
1691 PR c++/60642
1692 * decl2.c (is_late_template_attribute): Don't defer abi_tag.
1693 * mangle.c (write_unqualified_name): Fix abi_tag on templates.
1694 * pt.c (get_template_info): Handle NAMESPACE_DECL.
1695 (most_general_template): Handle more kinds of template.
1696 * tree.c (handle_abi_tag_attribute): Ignore abi_tag on template
1697 instantiations and specializations.
1698
1699 2014-03-31 Patrick Palka <patrick@parcs.ath.cx>
1700
1701 PR c++/44859
1702 * typeck.c (maybe_warn_about_returning_address_of_local): Unwrap
1703 COMPONENT_REFs and ARRAY_REFs sooner.
1704
1705 2014-03-29 Adam Butcher <adam@jessamine.co.uk>
1706
1707 PR c++/60626
1708 * parser.c (cp_parser_init_declarator): Handle erroneous generic type
1709 usage in non-functions with pushed scope.
1710
1711 2014-03-28 Adam Butcher <adam@jessamine.co.uk>
1712
1713 PR c++/60573
1714 * name-lookup.h (cp_binding_level): New transient field defining_class_p
1715 to indicate whether a scope is in the process of defining a class.
1716 * semantics.c (begin_class_definition): Set defining_class_p.
1717 * name-lookup.c (leave_scope): Reset defining_class_p.
1718 * parser.c (synthesize_implicit_template_parm): Use cp_binding_level::
1719 defining_class_p rather than TYPE_BEING_DEFINED as the predicate for
1720 unwinding to class-defining scope to handle the erroneous definition of
1721 a generic function of an arbitrarily nested class within an enclosing
1722 class.
1723
1724 2014-03-26 Fabien Chêne <fabien@gcc.gnu.org>
1725
1726 PR c++/52369
1727 * method.c (walk_field_subobs): Improve the diagnostic
1728 locations for both REFERENCE_TYPEs and non-static const members.
1729 * init.c (diagnose_uninitialized_cst_or_ref_member): Use %q#D
1730 instead of %qD to be consistent with the c++11 diagnostic.
1731
1732 2014-03-25 Jason Merrill <jason@redhat.com>
1733
1734 PR c++/60566
1735 PR c++/58678
1736 * class.c (build_vtbl_initializer): Handle abstract dtors here.
1737 * search.c (get_pure_virtuals): Not here.
1738
1739 PR c++/60375
1740 * parser.c (cp_parser_lambda_expression): Don't parse the body of
1741 a lambda in unevaluated context.
1742
1743 PR c++/60628
1744 * decl.c (create_array_type_for_decl): Complain about array of auto.
1745
1746 2014-03-25 Jakub Jelinek <jakub@redhat.com>
1747
1748 PR c++/60331
1749 * semantics.c (potential_constant_expression_1): Handle
1750 DECL_EXPR.
1751
1752 2014-03-24 Adam Butcher <adam@jessamine.co.uk>
1753
1754 PR c++/60627
1755 * parser.c (cp_parser_parameter_declaration_clause): Prevent 'auto' from
1756 introducing an implicit function template parameter within an explicit
1757 instantiation.
1758
1759 2014-03-22 Jason Merrill <jason@redhat.com>
1760
1761 PR c++/60574
1762 * decl.c (grokdeclarator): Change permerror about 'virtual auto'
1763 to error.
1764
1765 2014-03-21 Paolo Carlini <paolo.carlini@oracle.com>
1766
1767 PR c++/60384
1768 * name-lookup.c (push_class_level_binding_1): Check identifier_p
1769 on the name argument.
1770
1771 2014-03-20 Jakub Jelinek <jakub@redhat.com>
1772
1773 PR c++/60572
1774 * init.c (build_zero_init_1): Ignore fields with error_mark_node
1775 type.
1776
1777 2014-03-19 Paolo Carlini <paolo.carlini@oracle.com>
1778
1779 PR c++/51474
1780 * call.c (build_new_method_call_1): Handle pure virtuals called by
1781 NSDMIs too.
1782
1783 2014-03-17 Adam Butcher <adam@jessamine.co.uk>
1784
1785 PR c++/60390
1786 * parser.c (cp_parser_member_declaration): Don't allow
1787 finish_fully_implicit_template to consider friend declarations to be
1788 class member templates.
1789 (synthesize_implicit_template_parm): Handling winding back through class
1790 scope to the class being defined in order to inject a template argument
1791 list.
1792
1793 PR c++/60391
1794 * parser.c (cp_parser_skip_to_end_of_block_or_statement): Unwind generic
1795 function scope as per cp_parser_skip_to_end_of_statement.
1796
1797 2014-03-17 Paolo Carlini <paolo.carlini@oracle.com>
1798
1799 PR c++/59571
1800 * typeck2.c (check_narrowing): Use fold_non_dependent_expr_sfinae.
1801
1802 2014-03-14 Jason Merrill <jason@redhat.com>
1803
1804 PR c++/60532
1805 PR c++/58678
1806 * search.c (get_pure_virtuals): Handle abstract dtor here.
1807 (dfs_get_pure_virtuals): Not here.
1808
1809 PR c++/58678
1810 * search.c (dfs_get_pure_virtuals): Treat the destructor of an
1811 abstract class as pure.
1812
1813 2014-03-13 Paolo Carlini <paolo.carlini@oracle.com>
1814
1815 PR c++/60383
1816 * pt.c (maybe_process_partial_specialization): Check return value
1817 of check_specialization_namespace.
1818
1819 2014-03-13 Paolo Carlini <paolo.carlini@oracle.com>
1820
1821 PR c++/60254
1822 * semantics.c (finish_static_assert): Call cxx_constant_value only
1823 if require_potential_rvalue_constant_expression returns true.
1824
1825 2014-03-11 Paolo Carlini <paolo.carlini@oracle.com>
1826
1827 PR c++/60389
1828 * method.c (get_inherited_ctor): New.
1829 * cp-tree.h (get_inherited_ctor): Declare it.
1830 * semantics.c (is_valid_constexpr_fn): Use it.
1831
1832 2014-03-10 Jason Merrill <jason@redhat.com>
1833
1834 PR c++/60367
1835 * call.c (convert_default_arg): Remove special handling for
1836 CONSTRUCTOR.
1837
1838 PR c++/53492
1839 * parser.c (cp_parser_class_head): Also check PRIMARY_TEMPLATE_P
1840 when deciding whether to call push_template_decl for a member class.
1841 * pt.c (push_template_decl_real): Return after wrong levels error.
1842
1843 2014-03-08 Adam Butcher <adam@jessamine.co.uk>
1844
1845 PR c++/60033
1846 * pt.c (tsubst_copy): When retrieving a capture pack from a generic
1847 lambda, remove the lambda's own template argument list prior to fetching
1848 the specialization.
1849
1850 PR c++/60393
1851 * parser.c (cp_parser_parameter_declaration_clause): Move generic
1852 function template unwinding on error into a more general location, ...
1853 (cp_parser_skip_to_end_of_statement): ... here.
1854
1855 2014-03-07 Jason Merrill <jason@redhat.com>
1856
1857 * Make-lang.in (check_g++_parallelize): Split dg.exp.
1858
1859 * parser.c (cp_parser_type_id_1): Only allow 'auto' in C++1y if
1860 we're in a trailing return type.
1861
1862 * typeck.c (comp_template_parms_position): 'auto' and
1863 'decltype(auto)' are different from real template parms.
1864
1865 * parser.c (cp_parser_using_declaration): Consume the semicolon
1866 after bare parameter pack error.
1867
1868 * cp-tree.h (REF_PARENTHESIZED_P): New.
1869 * semantics.c (force_paren_expr): Set it.
1870 * pt.c (do_auto_deduction): Check it.
1871 (tsubst) [COMPONENT_REF]: Copy it.
1872 * typeck.c (maybe_warn_about_useless_cast): Don't strip dereference.
1873
1874 * decl.c (create_array_type_for_decl): Only warn about invalid
1875 C++1y VLA if flag_iso or warn_vla>0.
1876 (grokdeclarator): Likewise.
1877 * pt.c (tsubst): Likewise.
1878 * semantics.c (finish_decltype_type): Likewise.
1879 * typeck.c (cxx_sizeof_or_alignof_type): Likewise.
1880 (cp_build_addr_expr_1): Likewise.
1881 * init.c (build_new_1): Improve diagnostics.
1882
1883 2014-03-07 Paolo Carlini <paolo.carlini@oracle.com>
1884
1885 PR c++/58609
1886 * decl.c (check_initializer): Return NULL_TREE after error;
1887 consistently use inform.
1888
1889 2014-03-07 Paolo Carlini <paolo.carlini@oracle.com>
1890
1891 * decl.c (check_initializer): Remove dead code.
1892
1893 2014-03-06 Marek Polacek <polacek@redhat.com>
1894
1895 PR c/60197
1896 * typeck.c (check_return_expr): Call contains_cilk_spawn_stmt instead
1897 of checking tree code.
1898
1899 2014-03-06 Paolo Carlini <paolo.carlini@oracle.com>
1900
1901 * parser.c (cp_lexer_set_source_position): New.
1902 (cp_parser_mem_initializer): Use it.
1903 (cp_parser_postfix_open_square_expression): Likewise.
1904 (cp_parser_parenthesized_expression_list): Likewise.
1905 (cp_parser_new_initializer): Likewise.
1906 (cp_parser_jump_statement): Likewise.
1907 (cp_parser_initializer): Likewise.
1908 (cp_parser_functional_cast): Likewise.
1909
1910 2014-03-05 Jason Merrill <jason@redhat.com>
1911
1912 PR c++/60409
1913 * semantics.c (force_paren_expr): Only add a PAREN_EXPR to a
1914 dependent expression.
1915
1916 PR c++/60361
1917 * parser.c (cp_parser_template_id): Don't set up a CPP_TEMPLATE_ID
1918 if re-parsing might succeed.
1919 * semantics.c (finish_id_expression): Use of a parameter outside
1920 the function body is a parse error.
1921
1922 * parser.c (cp_parser_mem_initializer): Set input_location
1923 properly for init-list warning.
1924 (cp_parser_postfix_open_square_expression): Likewise.
1925 (cp_parser_parenthesized_expression_list): Likewise.
1926 (cp_parser_new_initializer): Likewise.
1927 (cp_parser_jump_statement): Likewise.
1928 (cp_parser_initializer): Likewise.
1929 (cp_parser_functional_cast): Likewise.
1930
1931 2014-03-04 Jason Merrill <jason@redhat.com>
1932
1933 PR c++/60417
1934 * typeck2.c (process_init_constructor_record): Set
1935 CONSTRUCTOR_IS_DIRECT_INIT on {} for omitted initializers.
1936
1937 PR c++/60415
1938 PR c++/54359
1939 * parser.c (cp_parser_direct_declarator): Set declarator to
1940 cp_error_declarator on invalid qualified-id.
1941
1942 2014-03-04 Paolo Carlini <paolo.carlini@oracle.com>
1943
1944 PR c++/60376
1945 * parser.c (cp_parser_using_declaration): Early return when
1946 cp_parser_nested_name_specifier errors out.
1947
1948 2014-03-01 Adam Butcher <adam@jessamine.co.uk>
1949
1950 PR c++/60377
1951 * parser.c (cp_parser_parameter_declaration_clause): Unwind generic
1952 function scope on parse error in function parameter list.
1953
1954 2014-03-01 Paolo Carlini <paolo.carlini@oracle.com>
1955
1956 * method.c (implicitly_declare_fn): Remove redundant
1957 DECL_TEMPLATE_RESULT and STRIP_TEMPLATE uses.
1958 * semantics.c (is_instantiation_of_constexpr): Likewise.
1959 * error.c (dump_function_decl): Likewise.
1960
1961 2014-03-01 Jason Merrill <jason@redhat.com>
1962
1963 PR c++/60379
1964 * semantics.c (begin_maybe_infinite_loop): Use
1965 fold_non_dependent_expr_sfinae.
1966
1967 2014-02-28 Jason Merrill <jason@redhat.com>
1968
1969 PR c++/58845
1970 * typeck.c (cp_build_binary_op): Sorry on vector&&vector.
1971
1972 2014-02-28 Paolo Carlini <paolo.carlini@oracle.com>
1973
1974 PR c++/58610
1975 * cp-tree.h (DECL_DELETED_FN): Use LANG_DECL_FN_CHECK.
1976 * call.c (print_z_candidate): Remove STRIP_TEMPLATE use.
1977 * lambda.c (maybe_add_lambda_conv_op): Likewise.
1978
1979 2014-02-27 Paolo Carlini <paolo.carlini@oracle.com>
1980
1981 PR c++/60253
1982 * call.c (convert_arg_to_ellipsis): Return error_mark_node after
1983 error_at.
1984
1985 2014-02-27 Jason Merrill <jason@redhat.com>
1986
1987 PR c++/60353
1988 PR c++/55877
1989 * decl2.c (tentative_decl_linkage): Don't mess with functions that
1990 are not yet defined.
1991
1992 2014-02-26 Jason Merrill <jason@redhat.com>
1993
1994 PR c++/60347
1995 PR lto/53808
1996 * class.c (clone_function_decl): Don't note_vague_linkage_fn.
1997 * init.c (build_vtbl_address): Do it here.
1998
1999 PR c++/59231
2000 PR c++/11586
2001 PR c++/14710
2002 PR c++/57132
2003 * pt.c (struct warning_sentinel): New.
2004 (tsubst_copy_and_build): Use it instead of
2005 c_inhibit_evaluation_warnings.
2006 * typeck.c (maybe_warn_about_useless_cast): Remove
2007 c_inhibit_evaluation_warnings check.
2008
2009 PR c++/54440
2010 * pt.c (get_template_parm_index): New.
2011 (fixed_parameter_pack_p_1, fixed_parameter_pack_p): New.
2012 (process_template_parm): Allow bare packs in template template
2013 parm template parms.
2014 (coerce_template_parameter_pack): Handle fixed template template
2015 parm packs and fixed packs not at the end of the parm list.
2016 (coerce_template_parms): Handle template parm packs not at the end
2017 of the parm list.
2018 (gen_elem_of_pack_expansion_instantiation): Handle a decl expansion.
2019
2020 PR c++/60182
2021 * pt.c (unify): Ignore alias templates when deducing a template
2022 template parameter.
2023
2024 PR c++/60345
2025 Revert:
2026 DR 1571
2027 * call.c (reference_binding): Recurse on user-defined conversion.
2028 (convert_like_real) [ck_ref_bind]: Explain cv-qual mismatch.
2029
2030 2014-02-25 Jason Merrill <jason@redhat.com>
2031
2032 DR 1571
2033 * call.c (reference_binding): Recurse on user-defined conversion.
2034 (convert_like_real) [ck_ref_bind]: Explain cv-qual mismatch.
2035
2036 * call.c (print_conversion_rejection): Handle n_arg of -2.
2037 (build_user_type_conversion_1): Pass it.
2038
2039 PR c++/55877
2040 * decl2.c (no_linkage_error): Handle C++98 semantics.
2041 (reset_type_linkage): Move from decl.c.
2042 (reset_type_linkage_1, reset_type_linkage_2, bt_reset_linkage_1)
2043 (bt_reset_linkage_2, reset_decl_linkage): New.
2044 (tentative_decl_linkage): Factor out of expand_or_defer_fn_1.
2045 (cp_write_global_declarations): Move condition into no_linkage_error.
2046 * decl.c (grokfndecl, grokvardecl): Use no_linkage_error.
2047 * semantics.c (expand_or_defer_fn_1): Factor out
2048 tentative_decl_linkage.
2049 * cp-tree.h: Adjust.
2050
2051 * decl2.c (finish_static_data_member_decl): Diagnose static data
2052 member in unnamed class.
2053 * class.c (finish_struct_anon_r): Avoid redundant diagnostic.
2054
2055 PR lto/53808
2056 * class.c (clone_function_decl): Call note_vague_linkage_fn for
2057 defaulted virtual dtor.
2058
2059 DR 1286
2060 PR c++/60328
2061 * pt.c (get_underlying_template): Fix equivalence calculation.
2062
2063 2014-02-25 Adam Butcher <adam@jessamine.co.uk>
2064
2065 PR c++/60311
2066 * parser.c (function_being_declared_is_template_p): Return false when
2067 processing a template parameter list.
2068 (cp_parser_parameter_declaration_clause): Don't set
2069 auto_is_implicit_function_template_parm_p when processing a
2070 template parameter list.
2071
2072 * parser.c (synthesize_implicit_template_parm): Inject new template
2073 argument list appropriately when a generic member function
2074 of a class template is declared out-of-line.
2075
2076 PR c++/60065
2077 * parser.c (cp_parser_direct_declarator): Don't save and
2078 restore num_template_parameter_lists around call to
2079 cp_parser_parameter_declaration_list.
2080 (function_being_declared_is_template_p): New predicate.
2081 (cp_parser_parameter_declaration_list): Use
2082 function_being_declared_is_template_p as predicate for
2083 inspecting current function template parameter list length
2084 rather than num_template_parameter_lists.
2085
2086 2014-02-24 Jason Merrill <jason@redhat.com>
2087
2088 PR c++/60146
2089 * pt.c (tsubst_omp_for_iterator): Don't let substitution of the
2090 DECL_EXPR initialize a non-class iterator.
2091
2092 PR c++/60312
2093 * parser.c (cp_parser_template_type_arg): Check for invalid 'auto'.
2094
2095 2014-02-21 Jason Merrill <jason@redhat.com>
2096
2097 PR c++/58170
2098 * parser.c (cp_parser_type_name): Always check dependency.
2099 (cp_parser_type_specifier_seq): Call
2100 cp_parser_parse_and_diagnose_invalid_type_name.
2101
2102 PR c++/60108
2103 * semantics.c (expand_or_defer_fn_1): Check DECL_DEFAULTED_FN.
2104
2105 PR c++/60185
2106 * parser.c (cp_parser_default_argument): Clear
2107 current_class_ptr/current_class_ref like tsubst_default_argument.
2108
2109 PR c++/60252
2110 * lambda.c (maybe_resolve_dummy): Check lambda_function rather
2111 than current_binding_level.
2112
2113 PR c++/60186
2114 * typeck2.c (massage_init_elt): Call fold_non_dependent_expr_sfinae.
2115
2116 PR c++/60187
2117 * parser.c (cp_parser_enum_specifier): Call
2118 check_for_bare_parameter_packs.
2119
2120 PR c++/59347
2121 * pt.c (tsubst_decl) [TYPE_DECL]: Don't try to instantiate an
2122 erroneous typedef.
2123
2124 PR c++/60241
2125 * pt.c (lookup_template_class_1): Update DECL_TEMPLATE_INSTANTIATIONS
2126 of the partial instantiation, not the most general template.
2127 (maybe_process_partial_specialization): Reassign everything on
2128 that list.
2129
2130 PR c++/60216
2131 * pt.c (register_specialization): Copy DECL_DELETED_FN to clones.
2132 (check_explicit_specialization): Don't clone.
2133
2134 PR c++/60219
2135 * pt.c (coerce_template_parms): Bail if argument packing fails.
2136
2137 PR c++/60224
2138 * decl.c (cp_complete_array_type, maybe_deduce_size_from_array_init):
2139 Don't get confused by a CONSTRUCTOR that already has a type.
2140
2141 PR c++/60227
2142 * call.c (build_array_conv): Don't crash on VLA.
2143
2144 PR c++/60248
2145 * mangle.c (mangle_decl): Don't make an alias for a TYPE_DECL.
2146
2147 PR c++/60252
2148 * lambda.c (maybe_resolve_dummy): Don't try to capture this
2149 in declaration context.
2150
2151 DR 1591
2152 PR c++/60051
2153 * pt.c (unify): Only unify if deducible. Handle 0-length list.
2154
2155 PR c++/60250
2156 * parser.c (cp_parser_direct_declarator): Don't wrap a
2157 type-dependent expression in a NOP_EXPR.
2158
2159 PR c++/60251
2160 * lambda.c (is_normal_capture_proxy): Handle VLA capture.
2161
2162 PR c++/60167
2163 PR c++/60222
2164 PR c++/58606
2165 * parser.c (cp_parser_template_argument): Restore dereference.
2166 * pt.c (template_parm_to_arg): Dereference non-pack expansions too.
2167 (process_partial_specialization): Handle deref.
2168 (unify): Likewise.
2169
2170 2014-02-21 Adam Butcher <adam@jessamine.co.uk>
2171
2172 PR c++/60052
2173 PR c++/60053
2174 * parser.c (cp_parser_parameter_declaration_list): Correctly reset
2175 implicit_template_scope upon leaving an out-of-line generic member
2176 function definition.
2177
2178 2014-02-20 Kai Tietz <ktietz@redhat.com>
2179
2180 PR c++/58873
2181 * parser.c (cp_parser_functional_cast): Treat NULL_TREE
2182 valued type argument as error_mark_node.
2183
2184 PR c++/58835
2185 * semantics.c (finish_fname): Handle error_mark_node.
2186
2187 2014-02-19 Jason Merrill <jason@redhat.com>
2188
2189 PR c++/60046
2190 * pt.c (maybe_instantiate_noexcept): Don't instantiate exception
2191 spec from template context.
2192
2193 2014-02-19 Jakub Jelinek <jakub@redhat.com>
2194
2195 PR debug/56563
2196 * cp-objcp-common.c (cp_function_decl_explicit_p): Remove
2197 FUNCTION_FIRST_USER_PARMTYPE (decl) != void_list_node check.
2198
2199 PR c++/60267
2200 * pt.c (tsubst_expr): Handle ANNOTATE_EXPR.
2201
2202 2014-02-18 Paolo Carlini <paolo.carlini@oracle.com>
2203
2204 PR c++/60225
2205 * semantics.c (ensure_literal_type_for_constexpr_object): Use
2206 strip_array_types.
2207
2208 2014-02-18 Paolo Carlini <paolo.carlini@oracle.com>
2209
2210 PR c++/60215
2211 * semantics.c (cxx_eval_constant_expression, [COMPONENT_REF]):
2212 During error recovery allow_non_constant may be false.
2213
2214 2014-02-18 Adam Butcher <adam@jessamine.co.uk>
2215
2216 PR c++/60190
2217 * parser.c (cp_parser_lambda_declarator_opt): Pop template parameter
2218 scope whenever a template parameter list has been started, independent
2219 of whether the function call operator was well-formed or not.
2220
2221 PR c++/60064
2222 * parser.c (cp_parser_member_declaration): Pop fully implicit template
2223 scope for generic friend declarations as well as for non-friends.
2224
2225 2014-02-12 Paolo Carlini <paolo.carlini@oracle.com>
2226
2227 PR c++/60047
2228 * method.c (implicitly_declare_fn): A constructor of a class with
2229 virtual base classes isn't constexpr (7.1.5p4).
2230
2231 2014-02-05 Jan Hubicka <hubicka@ucw.cz
2232
2233 * parser.c (synthesize_implicit_template_parm): Use grow_tree_vec.
2234
2235 2014-02-05 Jakub Jelinek <jakub@redhat.com>
2236
2237 PR c++/58703
2238 * parser.c (cp_parser_omp_declare_reduction): Save and free
2239 declarator_obstack.
2240
2241 2014-02-03 Marc Glisse <marc.glisse@inria.fr>
2242
2243 PR c++/53017
2244 PR c++/59211
2245 * tree.c (handle_init_priority_attribute): Call default_conversion on
2246 the attribute argument.
2247
2248 2014-02-03 Paolo Carlini <paolo.carlini@oracle.com>
2249
2250 PR c++/58871
2251 * method.c (synthesized_method_walk): If vbases is non-null but
2252 is_empty is true, likewise don't worry about the virtual bases.
2253
2254 2014-02-01 Paolo Carlini <paolo.carlini@oracle.com>
2255
2256 PR c++/51219
2257 * typeck2.c (process_init_constructor_record): Just skip unnamed
2258 bit-fields.
2259
2260 2014-01-31 Jason Merrill <jason@redhat.com>
2261
2262 PR c++/59469
2263 * pt.c (mark_decl_instantiated): Call mark_needed.
2264
2265 PR c++/58672
2266 * decl2.c (handle_tls_init): Handle null init fn.
2267
2268 PR c++/55800
2269 * decl2.c (get_tls_init_fn): Copy DECL_EXTERNAL from the variable.
2270
2271 2014-01-31 Paolo Carlini <paolo.carlini@oracle.com>
2272
2273 PR c++/59082
2274 * class.c (build_vfield_ref): Early return error_mark_node if
2275 TYPE_VFIELD (type) is null.
2276 (build_base_path): Check return value of build_vfield_ref.
2277
2278 2014-01-31 Jason Merrill <jason@redhat.com>
2279
2280 PR c++/59646
2281 * call.c (convert_like_real) [ck_aggr]: Set TARGET_EXPR_LIST_INIT_P.
2282 [ck_list]: Check for error_mark_node.
2283 (build_aggr_conv): Set LOOKUP_NO_NARROWING and check_narrowing.
2284
2285 PR c++/57043
2286 * pt.c (fn_type_unification): Don't do DEDUCE_EXACT check
2287 during partial ordering.
2288
2289 2014-01-31 Marek Polacek <polacek@redhat.com>
2290
2291 PR c/59963
2292 * typeck.c (build_function_call_vec): Add dummy arg_loc parameter.
2293
2294 2014-01-30 Jason Merrill <jason@redhat.com>
2295
2296 PR c++/57899
2297 * cp-tree.h (struct saved_scope): Add x_local_specializations.
2298 (local_specializations): New macro.
2299 * pt.c (local_specializations): Remove variable.
2300
2301 2014-01-30 Richard Sandiford <rdsandiford@googlemail.com>
2302
2303 PR c++/58708
2304 * parser.c (make_string_pack): Use double_int::from_buffer.
2305
2306 2014-01-30 Marek Polacek <polacek@redhat.com>
2307
2308 PR c/59940
2309 * typeck.c (build_ptrmemfunc1): Call convert_and_check with
2310 input_location.
2311 * cvt.c (cp_convert_and_check): Call warnings_for_convert_and_check
2312 with input_location.
2313 * call.c (build_conditional_expr_1): Call unsafe_conversion_p with
2314 loc parameter.
2315
2316 2014-01-30 Paolo Carlini <paolo.carlini@oracle.com>
2317
2318 PR c++/58843
2319 * typeck.c (lookup_destructor): Check dtor_type for error_mark_node.
2320
2321 2014-01-30 Paolo Carlini <paolo.carlini@oracle.com>
2322
2323 PR c++/58649
2324 * pt.c (lookup_template_class_1): Check start_enum return value
2325 for error_mark_node.
2326
2327 2014-01-30 Paolo Carlini <paolo.carlini@oracle.com>
2328
2329 * decl.c (duplicate_decls, typename_hash, typename_compare):
2330 Use TYPE_IDENTIFIER.
2331 * error.c (dump_type): Likewise.
2332 * mangle.c (dump_substitution_candidates): Likewise.
2333
2334 2014-01-30 Jason Merrill <jason@redhat.com>
2335
2336 PR c++/59633
2337 * decl2.c (attributes_naming_typedef_ok): New.
2338 * cp-tree.h: Declare it.
2339 * decl.c (grokdeclarator): Check it.
2340 * tree.c (no_linkage_check): Handle VECTOR_TYPE.
2341
2342 2014-01-29 Jason Merrill <jason@redhat.com>
2343
2344 PR c++/59707
2345 * call.c (add_builtin_candidate): Catch dependent types.
2346
2347 PR c++/59989
2348 * pt.c (expand_template_argument_pack): Correct
2349 non_default_args_count calculation.
2350
2351 PR c++/58466
2352 * pt.c (unify_pack_expansion): Call expand_template_argument_pack.
2353
2354 PR c++/59956
2355 * friend.c (do_friend): Pass the TEMPLATE_DECL to add_friend if we
2356 have a friend template in a class template.
2357 * pt.c (tsubst_friend_function): Look through it.
2358 (push_template_decl_real): A friend member template is
2359 primary.
2360
2361 2014-01-29 Paolo Carlini <paolo.carlini@oracle.com>
2362
2363 PR c++/58846
2364 * decl.c (get_dso_handle_node): Don't crash if dso_handle_node
2365 == error_mark_node.
2366
2367 2014-01-29 Paolo Carlini <paolo.carlini@oracle.com>
2368
2369 PR c++/58674
2370 * pt.c (instantiate_template_1): Check for error_mark_node the second
2371 argument too.
2372
2373 2014-01-29 Jason Merrill <jason@redhat.com>
2374
2375 PR c++/59916
2376 * optimize.c (maybe_thunk_body): Build a RETURN_EXPR for
2377 cdtor_returns_this case.
2378
2379 PR c++/59315
2380 * decl.c (cxx_maybe_build_cleanup): Call mark_used.
2381
2382 2014-01-29 Paolo Carlini <paolo.carlini@oracle.com>
2383
2384 PR c++/58702
2385 * semantics.c (finish_omp_reduction_clause): Check type for
2386 error_mark_node.
2387
2388 2014-01-28 Jason Merrill <jason@redhat.com>
2389
2390 PR c++/59791
2391 * pt.c (tsubst_decl) [VAR_DECL]: Allow in unevaluated context.
2392 (tsubst_copy): Use it if lookup fails.
2393
2394 PR c++/59818
2395 * pt.c (tsubst_function_type): Make sure we keep the same function
2396 quals.
2397
2398 PR c++/58701
2399 * semantics.c (build_anon_member_initialization): Stop walking
2400 when we run out of COMPONENT_REFs.
2401
2402 PR c++/58632
2403 * decl.c (lookup_and_check_tag): Ignore template parameters if
2404 scope == ts_current.
2405 * pt.c (check_template_shadow): Don't complain about the injected
2406 class name.
2407
2408 * decl.c (duplicate_decls): Tweak.
2409
2410 PR c++/53756
2411 * mangle.c (write_unqualified_name): Handle operator auto.
2412
2413 2014-01-27 Jason Merrill <jason@redhat.com>
2414
2415 PR c++/59823
2416 Core DR 1138
2417 * call.c (reference_binding): Pass LOOKUP_NO_TEMP_BIND for
2418 list-initialization. A conversion to rvalue ref that involves
2419 an lvalue-rvalue conversion is bad.
2420 (convert_like_real): Give helpful error message.
2421
2422 PR c++/54652
2423 * decl.c (duplicate_decls): Always use oldtype for TYPE_DECL.
2424
2425 PR c++/58504
2426 * pt.c (tsubst_copy_and_build) [TRAIT_EXPR]: Use tsubst for
2427 types.
2428
2429 PR c++/58606
2430 * pt.c (template_parm_to_arg): Call convert_from_reference.
2431 (tsubst_template_arg): Don't strip reference refs.
2432
2433 PR c++/58639
2434 * call.c (build_aggr_conv): Reject value-initialization of reference.
2435
2436 PR c++/58812
2437 PR c++/58651
2438 * call.c (convert_like_real): Give helpful error about excess braces
2439 for ck_rvalue of scalar type.
2440
2441 Core DR 1288
2442 * call.c (reference_binding): Only elide braces if the single
2443 element is reference-related.
2444
2445 PR c++/58814
2446 * typeck.c (cp_build_modify_expr): Make the RHS an rvalue before
2447 stabilizing.
2448
2449 PR c++/58837
2450 * typeck.c (cp_truthvalue_conversion): Use explicit comparison for
2451 FUNCTION_DECL.
2452
2453 PR c++/59097
2454 * decl.c (compute_array_index_type): Don't call
2455 maybe_constant_value for a non-integral expression.
2456
2457 2014-01-24 Balaji V. Iyer <balaji.v.iyer@intel.com>
2458
2459 * call.c (magic_varargs_p): Replaced flag_enable_cilkplus with
2460 flag_cilkplus.
2461 * cp-gimplify.c (cp_genericize): Likewise.
2462 * decl.c (grokfndecl): Likewise.
2463 * parser.c (cp_parser_postfix_expression): Likewise.
2464 (cp_parser_postfix_open_square_expression): Likewise.
2465 (cp_parser_direct_declarator): Likewise.
2466 (is_cilkplus_vector_p): Likewise.
2467 (cp_parser_omp_clause_name): Likewise.
2468 (cp_parser_omp_all_clauses): Likewise.
2469 * pt.c (apply_late_template_attributes): Likewise.
2470 * typeck.c (cp_build_array_ref): Likewise.
2471 (cp_build_compound_expr): Likewise.
2472 (check_return_expr): Likewise.
2473
2474 2014-01-24 Jason Merrill <jason@redhat.com>
2475
2476 PR c++/58550
2477 * decl.c (grokdeclarator): Turn pedwarn about auto return type in
2478 c++11 into error.
2479
2480 PR c++/59886
2481 PR c++/59659
2482 * typeck2.c (process_init_constructor_array): Don't create
2483 RANGE_EXPR yet.
2484
2485 2014-01-24 Jakub Jelinek <jakub@redhat.com>
2486
2487 * typeck2.c (split_nonconstant_init_1): Fix num_split_elts
2488 handling for RANGE_ARRAY case.
2489
2490 2014-01-24 Paolo Carlini <paolo.carlini@oracle.com>
2491
2492 PR c++/57524
2493 * name-lookup.c (push_using_directive): Use timevar_cond_start.
2494
2495 2014-01-23 Marek Polacek <polacek@redhat.com>
2496
2497 PR c/59846
2498 * typeck.c (cp_build_binary_op): Pass location to shorten_compare.
2499
2500 2014-01-23 Marek Polacek <polacek@redhat.com>
2501
2502 PR c/58346
2503 * typeck.c (pointer_diff): Give an error on arithmetic on pointer to
2504 an empty aggregate.
2505
2506 2014-01-23 Jason Merrill <jason@redhat.com>
2507
2508 PR c++/55189
2509 * cp-tree.h (struct language_function): Add infinite_loop and
2510 infinite_loops.
2511 (current_function_infinite_loop): New.
2512 * semantics.c (begin_maybe_infinite_loop, end_maybe_infinite_loop)
2513 (break_maybe_infinite_loop): New.
2514 (finish_while_stmt_cond, finish_while_stmt, begin_do_stmt)
2515 (finish_do_stmt, finish_for_cond, finish_for_stmt)
2516 (begin_range_for_stmt): Use them.
2517 * decl.c (finish_function): Don't warn about missing return
2518 if current_function_infinite_loop.
2519 * pt.c (instantiate_decl): Copy current_function_infinite_loop.
2520 * parser.c (cp_parser_jump_statement): Call break_maybe_infinite_loop.
2521
2522 * call.c (build_op_delete_call): Use make_tree_vector and
2523 release_tree_vector.
2524
2525 2014-01-23 Paolo Carlini <paolo.carlini@oracle.com>
2526
2527 PR c++/58980
2528 * parser.c (cp_parser_enum_specifier): Handle TYPENAME_TYPE as
2529 nested_name_specifier.
2530
2531 2014-01-23 Balaji V. Iyer <balaji.v.iyer@intel.com>
2532
2533 * parser.c (cp_parser_direct_declarator): When Cilk Plus is enabled
2534 see if there is an attribute after function decl. If so, then
2535 parse them now.
2536 (cp_parser_late_return_type_opt): Handle parsing of Cilk Plus SIMD
2537 enabled function late parsing.
2538 (cp_parser_gnu_attribute_list): Parse all the tokens for the vector
2539 attribute for a SIMD-enabled function.
2540 (cp_parser_omp_all_clauses): Skip parsing to the end of pragma when
2541 the function is used by SIMD-enabled function (indicated by NULL
2542 pragma token). Added 3 new clauses: PRAGMA_CILK_CLAUSE_MASK,
2543 PRAGMA_CILK_CLAUSE_NOMASK and PRAGMA_CILK_CLAUSE_VECTORLENGTH
2544 (cp_parser_cilk_simd_vectorlength): Modified this function to handle
2545 vectorlength clause in SIMD-enabled function and #pragma SIMD's
2546 vectorlength clause. Added a new bool parameter to differentiate
2547 between the two.
2548 (cp_parser_cilk_simd_fn_vector_attrs): New function.
2549 (is_cilkplus_vector_p): Likewise.
2550 (cp_parser_late_parsing_elem_fn_info): Likewise.
2551 (cp_parser_omp_clause_name): Added a check for "mask", "nomask"
2552 and "vectorlength" clauses when Cilk Plus is enabled.
2553 (cp_parser_omp_clause_linear): Added a new parameter of type bool
2554 and emit a sorry message when step size is a parameter.
2555 * parser.h (cp_parser::cilk_simd_fn_info): New field.
2556 * decl.c (grokfndecl): Added flag_enable_cilkplus along with
2557 flag_openmp.
2558 * pt.c (apply_late_template_attributes): Likewise.
2559
2560 2014-01-23 Jakub Jelinek <jakub@redhat.com>
2561
2562 PR middle-end/58809
2563 * semantics.c (finish_omp_reduction_clause): Reject
2564 BIT_AND_EXPR, BIT_IOR_EXPR and BIT_XOR_EXPR on COMPLEX_TYPEs.
2565
2566 2014-01-22 Ville Voutilainen <ville.voutilainen@gmail.com>
2567
2568 PR c++/59482
2569 * parser.c (cp_parser_class_head): Push the class before parsing
2570 the base-clause, pop after it.
2571
2572 2014-01-20 Eric Botcazou <ebotcazou@adacore.com>
2573
2574 * decl2.c (cpp_check): Revert prototype change.
2575
2576 2014-01-17 Paolo Carlini <paolo.carlini@oracle.com>
2577
2578 PR c++/59270
2579 PR c++/58811
2580 * init.c (build_value_init_noctor): Don't pass error_mark_node to
2581 build_value_init.
2582
2583 2014-01-17 Paolo Carlini <paolo.carlini@oracle.com>
2584
2585 PR c++/59269
2586 * init.c (build_value_init_noctor): Assert !TYPE_HAS_COMPLEX_DFLT
2587 only when errorcount == 0.
2588
2589 2014-01-17 Marek Polacek <polacek@redhat.com>
2590
2591 PR c++/59838
2592 * cvt.c (ocp_convert): Don't segfault on non-existing
2593 ENUM_UNDERLYING_TYPE.
2594
2595 2014-01-16 Jason Merrill <jason@redhat.com>
2596
2597 PR c++/59821
2598 * tree.c (bot_manip): Update the location of builtin_LINE and
2599 builtin_FILE calls.
2600
2601 2014-01-14 Jason Merrill <jason@redhat.com>
2602
2603 PR c++/59659
2604 * typeck2.c (massage_init_elt): New.
2605 (process_init_constructor_record)
2606 (process_init_constructor_union): Use it.
2607 (process_init_constructor_array): Use it. Use RANGE_EXPR.
2608 (split_nonconstant_init_1): Handle it.
2609 * semantics.c (cxx_eval_vec_init_1): Use force_rvalue.
2610
2611 2014-01-09 Balaji V. Iyer <balaji.v.iyer@intel.com>
2612
2613 PR c++/59631
2614 * parser.c (cp_parser_postfix_expression): Added a new if-statement
2615 and replaced an existing if-statement with else-if statement.
2616 Changed an existing error message wording to match the one from the C
2617 parser.
2618
2619 2014-01-08 Jason Merrill <jason@redhat.com>
2620
2621 PR c++/59614
2622 * class.c (abi_tag_data): Add tags field.
2623 (check_abi_tags): Initialize it.
2624 (find_abi_tags_r): Support collecting missing tags.
2625 (mark_type_abi_tags): Don't look at template args.
2626 (inherit_targ_abi_tags): New.
2627 (check_bases_and_members): Use it.
2628 * cp-tree.h (ABI_TAG_IMPLICIT): New.
2629 * mangle.c (write_abi_tags): Check it.
2630
2631 2014-01-07 Jason Merrill <jason@redhat.com>
2632
2633 PR c++/58856
2634 * pt.c (num_innermost_template_parms): New.
2635 (get_underlying_template): Use it.
2636
2637 PR c++/58965
2638 * mangle.c (write_guarded_var_name): Handle null DECL_NAME.
2639
2640 2014-01-07 Paolo Carlini <paolo.carlini@oracle.com>
2641
2642 * semantics.c (trait_expr_value, [CPTK_IS_BASE_OF]): Implement
2643 the letter of 20.11.6 about Base and Derived naming the same
2644 class type modulo cv-qualifiers.
2645
2646 2014-01-06 Adam Butcher <adam@jessamine.co.uk>
2647
2648 PR c++/59635
2649 * lambda.c (maybe_add_lambda_conv_op): Handle marking conversion
2650 function as unimplemented for generic lambdas with varargs.
2651
2652 PR c++/59636
2653 * parser.c (cp_parser_template_parameter): Early out with
2654 error_mark_node if parameter declaration was not parsed.
2655
2656 PR c++/59629
2657 * parser.c (cp_parser_lambda_expression): Save/reset/restore
2658 auto_is_implicit_function_template_parm_p around lambda body.
2659
2660 PR c++/59638
2661 * parser.c (cp_parser_init_declarator): Undo fully implicit
2662 template parameter list when declarator is not a function.
2663
2664 2014-01-03 Marc Glisse <marc.glisse@inria.fr>
2665
2666 PR c++/58950
2667 * cvt.c (convert_to_void): Handle VEC_PERM_EXPR and VEC_COND_EXPR.
2668
2669 2014-01-03 Tobias Burnus <burnus@net-b.de>
2670
2671 PR c++/58567
2672 * pt.c (tsubst_omp_for_iterator): Early return for error_mark_node.
2673
2674 2014-01-03 Paolo Carlini <paolo.carlini@oracle.com>
2675
2676 Core DR 1442
2677 PR c++/59165
2678 * parser.c (cp_parser_perform_range_for_lookup): Don't pass true
2679 as include_std to perform_koenig_lookup.
2680 (cp_parser_postfix_expression): Adjust.
2681 * pt.c (tsubst_copy_and_build): Likewise.
2682 * semantics.c (perform_koenig_lookup): Remove bool parameter.
2683 (omp_reduction_lookup): Adjust.
2684 * name-lookup.c (lookup_arg_dependent_1): Remove bool parameter.
2685 (lookup_arg_dependent): Likewise.
2686 (lookup_function_nonclass): Adjust.
2687 * name-lookup.h: Adjust declaration.
2688 * cp-tree.h: Likewise.
2689
2690 2014-01-02 Marc Glisse <marc.glisse@inria.fr>
2691
2692 PR c++/59087
2693 * parser.c (cp_parser_userdef_numeric_literal): Mention
2694 -fext-numeric-literals in the message.
2695
2696 2014-01-02 Marc Glisse <marc.glisse@inria.fr>
2697
2698 PR c++/59641
2699 * call.c (build_conditional_expr_1): Check the return value of
2700 force_rvalue.
2701
2702 2014-01-02 Marc Glisse <marc.glisse@inria.fr>
2703
2704 * call.c (convert_like_real): Check complain.
2705
2706 2014-01-02 Marc Glisse <marc.glisse@inria.fr>
2707
2708 PR c++/59378
2709 * typeck.c (build_x_vec_perm_expr): Handle non-dependent arguments
2710 in templates.
2711
2712 2014-01-02 Richard Sandiford <rdsandiford@googlemail.com>
2713
2714 Update copyright years
2715
2716 2014-01-02 Richard Sandiford <rdsandiford@googlemail.com>
2717
2718 * cp-array-notation.c, cp-cilkplus.c, vtable-class-hierarchy.c: Use
2719 the standard form for the copyright notice.
2720 \f
2721 Copyright (C) 2014 Free Software Foundation, Inc.
2722
2723 Copying and distribution of this file, with or without modification,
2724 are permitted in any medium without royalty provided the copyright
2725 notice and this notice are preserved.