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