7bec9ca96caa3da802335b9c88596a745cad58e5
[gcc.git] / gcc / cp / ChangeLog
1 2012-12-06 Jason Merrill <jason@redhat.com>
2
3 PR c++/54325
4 * tree.c (build_aggr_init_expr): Don't check for abstract class.
5 (build_cplus_new): Check here instead.
6
7 PR c++/55058
8 * pt.c (tsubst): Keep the quals when looking through a typedef.
9
10 PR c++/55249
11 * tree.c (build_vec_init_elt): Use the type of the initializer.
12
13 PR c++/54744
14 * pt.c (resolve_typename_type): Check TYPENAME_IS_RESOLVING_P on scope.
15 * init.c (expand_member_init): Check for being in a template first.
16 * parser.c (cp_parser_mem_initializer_list): Only check class types
17 for equivalence to the current class.
18
19 PR c++/54913
20 * semantics.c (finish_qualified_id_expr): convert_from_reference
21 after building a SCOPE_REF.
22
23 2012-12-06 Jakub Jelinek <jakub@redhat.com>
24
25 PR c++/54207
26 * except.c (build_noexcept_spec): Avoid direct comparison
27 with boolean_true_node or boolean_false_node, instead use
28 operand_equal_p and/or INTEGER_CST check.
29 * pt.c (tsubst_exception_specification): Likewise.
30 * typeck2.c (merge_exception_specifiers): Likewise.
31
32 2012-12-06 Marc Glisse <marc.glisse@inria.fr>
33
34 PR c++/55573
35 * semantics.c (adjust_temp_type): Handle VECTOR_CST.
36
37 2012-12-06 Jason Merrill <jason@redhat.com>
38
39 PR c++/54947
40 * parser.c (cp_parser_initializer_list): Don't require an
41 expression in [] to be constant until we know it's a C99
42 designator.
43
44 PR c++/55015
45 PR c++/53821
46 * semantics.c (maybe_add_lambda_conv_op): Revert earlier change.
47 * decl.c (start_preparsed_function): Make local class methods comdat
48 in templates, too.
49
50 PR c++/54653
51 * parser.c (cp_parser_class_head): A partial specialization scope
52 counts as a template.
53 * pt.c (tsubst_template_parms): Handle template template parm parms.
54 (tsubst_decl) [TEMPLATE_DECL]: Handle getting a template template
55 argument back.
56
57 PR c++/55564
58 * pt.c (unify) [ARRAY_TYPE]: Unify the element type before the bounds.
59
60 2012-12-03 Paolo Carlini <paolo.carlini@oracle.com>
61
62 PR c++/54170
63 * cvt.c (cp_convert_to_pointer): Don't discard side-effects from
64 expressions of nullptr_t.
65 * typeck.c (build_ptrmemfunc): Likewise.
66
67 2012-12-01 Jakub Jelinek <jakub@redhat.com>
68
69 PR c++/55542
70 * pt.c (make_ith_pack_parameter_name): Return NULL if
71 name is NULL.
72 (tsubst_decl): Call make_ith_pack_parameter_name even if
73 DECL_NAME is NULL.
74
75 2012-11-29 Jason Merrill <jason@redhat.com>
76
77 PR c++/53137
78 * pt.c (tsubst_expr) [DECL_EXPR]: Set LAMBDA_EXPR_THIS_CAPTURE here.
79 (tsubst_copy_and_build) [LAMBDA_EXPR]: And clear it here.
80 (instantiate_class_template_1): Not here.
81
82 2012-11-29 Marc Glisse <marc.glisse@inria.fr>
83
84 PR c++/53094
85 * cvt.c (ocp_convert): Call convert_to_vector.
86
87 2012-11-29 Kai Tietz <ktietz@redhat.com>
88
89 PR target/53912
90 * class.c (dump_class_hierarchy_r): Cast from pointer via uintptr_t.
91 (dump_vtable): Likewise.
92
93 2012-11-29 Ed Smith-Rowland <3dw4rd@verizon.net>
94
95 PR c++/52654
96 * parser.c (cp_parser_string_literal): Add overflow_type arg.
97 (cp_parser_userdef_numeric_literal): Warn on numeric overflow.
98
99 2012-11-28 Andrew Pinski <apinski@cavium.com>
100
101 PR bootstrap/54279
102 * Make-lang.in (g++$(exeext)): Rename to
103 (xg++$(exeext)): This.
104 (g++-cross$(exeext)): Use xg++$(exeext) instead of g++$(exeext).
105 (c++.start.encap): Likewise.
106 (c++.install-common): Likewise.
107
108 2012-11-24 Paolo Carlini <paolo.carlini@oracle.com>
109
110 PR c++/55446
111 * init.c (build_vec_init): Do not early return error_mark_mode
112 when integer_all_onesp (maxindex).
113
114 2012-11-23 Jakub Jelinek <jakub@redhat.com>
115
116 PR c++/54046
117 * cp-objcp-common.h (LANG_HOOKS_BLOCK_MAY_FALLTHRU): Redefine.
118 * cp-objcp-common.c (cxx_block_may_fallthru): New function.
119 * cp-tree.h (cxx_block_may_fallthru): New prototype.
120
121 2012-11-23 Markus Trippelsdorf <markus@trippelsdorf.de>
122
123 PR c++/55418
124 * method.c (implicitly_declare_fn): Properly initialize trivial_p.
125
126 2012-11-22 Jason Merrill <jason@redhat.com>
127
128 PR c++/55137
129 * semantics.c (verify_constant): Track overflow separately.
130 (reduced_constant_expression_p): Don't check it here.
131 (cxx_eval_constant_expression): Check it on CSTs.
132 (cxx_eval_outermost_constant_expr): Treat overflows as non-constant
133 at this point, but still return the folded version.
134 (potential_constant_expression_1): Don't check overflow.
135
136 * call.c (extend_ref_init_temps_1): Recompute TREE_CONSTANT for
137 the ADDR_EXPR.
138
139 2012-11-20 Diego Novillo <dnovillo@google.com>
140 Jakub Jelinek <jakub@redhat.com>
141
142 * name-lookup.c: Replace all vec<T, A>() initializers
143 with vNULL.
144 * semantics.c: Likewise.
145
146 2012-11-19 Paolo Carlini <paolo.carlini@oracle.com>
147
148 PR c++/55368
149 * parser.c (cp_parser_member_declaration): Emit an error in case
150 of stray comma at end of member declaration.
151
152 2012-11-19 Jason Merrill <jason@redhat.com>
153
154 * class.c (one_inheriting_sig): Don't inherit base copy ctors.
155
156 PR c++/55262
157 * method.c (implicitly_declare_fn): Set DECL_PARM_INDEX on
158 the parms of an inheriting ctor.
159
160 PR c++/55261
161 * class.c (add_implicitly_declared_members): Use
162 lookup_fnfields_slot to get the base constructors.
163
164 2012-11-19 Jakub Jelinek <jakub@redhat.com>
165
166 PR middle-end/54630
167 * class.c (fixed_type_or_null_ref_ht): New variable.
168 (fixed_type_or_null): Use it instead of local static ht.
169
170 2012-11-17 Diego Novillo <dnovillo@google.com>
171
172 Adjust for new vec API (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec)
173
174 * Make-lang.in: Remove dependencies on vecir.h and vecprim.h everywhere.
175 * call.c: Use new vec API in vec.h.
176 * class.c: Likewise.
177 * cp-gimplify.c: Likewise.
178 * cp-tree.h: Likewise.
179 * cvt.c: Likewise.
180 * decl.c: Likewise.
181 * decl2.c: Likewise.
182 * error.c: Likewise.
183 * except.c: Likewise.
184 * init.c: Likewise.
185 * mangle.c: Likewise.
186 * method.c: Likewise.
187 * name-lookup.c: Likewise.
188 * name-lookup.h: Likewise.
189 * parser.c: Likewise.
190 * parser.h: Likewise.
191 * pt.c: Likewise.
192 * repo.c: Likewise.
193 * rtti.c: Likewise.
194 * search.c: Likewise.
195 * semantics.c: Likewise.
196 * tree.c: Likewise.
197 * typeck.c: Likewise.
198 * typeck2.c: Likewise.
199
200 2012-11-17 Gabriel Dos Reis <gdr@integrable-solutions.net>
201
202 * semantics.c (finish_id_expression): Tidy diagnostic message.
203
204 2012-11-16 Dodji Seketeli <dodji@redhat.com>
205
206 PR c++/54875
207 * pt.c (lookup_template_class_1): Look at the type of the
208 potential member enum of class template to determine if we are
209 actually substituting into a member enum of class template.
210
211 2012-11-16 Jakub Jelinek <jakub@redhat.com>
212
213 PR c++/55337
214 * tree.c (cp_tree_equal) <case ALIGNOF_EXPR>: Use SIZEOF_EXPR_TYPE_P
215 only on SIZEOF_EXPR.
216
217 2012-11-14 Jason Merrill <jason@redhat.com>
218
219 PR c++/54903
220 * decl2.c (mark_used): Don't complain about auto in templates.
221
222 PR c++/37276
223 * decl.c (decls_match): Remove #ifdef around earlier fix.
224
225 2012-11-13 Jason Merrill <jason@redhat.com>
226
227 * class.c (finish_struct_1): Check virtual functions
228 for missing ABI tags.
229
230 PR c++/55275
231 * pt.c (maybe_process_partial_specialization): Update
232 DECL_SOURCE_LOCATION for new specializations.
233
234 2012-11-14 Paolo Carlini <paolo.carlini@oracle.com>
235
236 PR c++/55323
237 * init.c (emit_mem_initializers): Skip arguments == error_mark_node.
238
239 2012-11-14 Fabien ChĂȘne <fabien@gcc.gnu.org>
240
241 PR c++/11750
242 * call.c (build_new_method_call_1): Check that the instance type
243 and the function context are the same before setting the flag
244 LOOKUP_NONVIRTUAL.
245
246 2012-11-13 Sriraman Tallam <tmsriram@google.com>
247
248 * class.c (mark_versions_used): Remove.
249 (resolve_address_of_overloaded_function): Call target hook
250 for versioned functions. Refactor to call
251 get_function_versions_dispatcher.
252 * decl.c (duplicate_decls): Add comments.
253 * cp/call.c (get_function_version_dispatcher): Expose function.
254 (mark_versions_used): Expose function.
255 * cp/cp-tree.h (mark_versions_used): New declaration.
256 (get_function_version_dispatcher): Ditto.
257
258 2012-11-13 Dodji Seketeli <dodji@redhat.com>
259
260 PR c++/54466
261 * pt.c (lookup_template_class_1): TYPE_STUB_DECL should be
262 accessed on the main variant of the type.
263
264 2012-11-12 Ed Smith-Rowland <3dw4rd@verizon.net>
265
266 * parser.c (cp_parser_objc_class_ivars):
267 Index declspecs.locations by ds_typedef rather than ds_thread.
268
269 2012-11-09 Ed Smith-Rowland <3dw4rd@verizon.net>
270
271 PR c++/54413
272 * decl.c (grokfndecl): Adjust calls to interpret_x_suffix.
273
274 2012-11-09 Jason Merrill <jason@redhat.com>
275
276 PR c++/54859
277 * pt.c (check_instantiated_arg): Don't complain about dependent args.
278
279 * tree.c (cxx_attribute_table): Add abi_tag attribute.
280 (check_abi_tag_redeclaration, handle_abi_tag_attribute): New.
281 * class.c (find_abi_tags_r, check_abi_tags): New.
282 (check_bases, check_field_decl): Call check_abi_tags.
283 * decl.c (redeclaration_error_message): Call
284 check_abi_tag_redeclaration.
285 * mangle.c (tree_string_cmp, write_abi_tags): New.
286 (write_unqualified_name): Call write_abi_tags.
287
288 2012-11-07 Paolo Carlini <paolo.carlini@oracle.com>
289
290 PR c++/55226
291 Revert:
292 2012-10-23 Paolo Carlini <paolo.carlini@oracle.com>
293
294 PR c++/54922
295 * semantics.c (cx_check_missing_mem_inits): Handle anonymous union
296 members.
297
298 2012-11-07 Florian Weimer <fweimer@redhat.com>
299
300 * init.c (build_new_1): Do not check for arithmetic overflow if
301 inner array size is 1.
302
303 2012-11-05 Sriraman Tallam <tmsriram@google.com>
304
305 * class.c (add_method): Change assembler names of function versions.
306 (mark_versions_used): New static function.
307 (resolve_address_of_overloaded_function): Create dispatcher decl and
308 return address of dispatcher instead.
309 * decl.c (decls_match): Make decls unmatched for versioned
310 functions.
311 (duplicate_decls): Remove ambiguity for versioned functions.
312 Delete versioned function data for merged decls.
313 * decl2.c (check_classfn): Check attributes of versioned functions
314 for match.
315 * call.c (get_function_version_dispatcher): New function.
316 (mark_versions_used): New static function.
317 (build_over_call): Make calls to multiversioned functions
318 to call the dispatcher.
319 (joust): For calls to multi-versioned functions, make the most
320 specialized function version win.
321
322 2012-10-31 Lawrence Crowl <crowl@google.com>
323
324 * decl2.c (var_finalized_p): Rename varpool_node to
325 varpool_node_for_decl.
326 (maybe_emit_vtables): Likewise.
327
328 2012-10-31 Paolo Carlini <paolo.carlini@oracle.com>
329
330 PR c++/54583
331 * tree.c (build_cplus_array_type): Set TREE_NO_WARNING on the
332 TYPE_SIZE of VLAs.
333
334 2012-10-31 Dodji Seketeli <dodji@redhat.com>
335
336 PR c++/54955
337 * parser.c (cp_nth_tokens_can_be_std_attribute_p): Recognize the
338 'Alignas' keyword as the beginning of a c++11 attribute specifier.
339 Update the comment of the function.
340 (cp_next_tokens_can_be_gnu_attribute_p): Update the comment of the
341 function.
342
343 2012-10-29 Jonathan Wakely <jwakely.gcc@gmail.com>
344
345 PR c++/54930
346 * typeck.c (maybe_warn_about_returning_address_of_local): Use
347 OPT_Wreturn_local_addr.
348
349 2012-10-26 Jakub Jelinek <jakub@redhat.com>
350
351 PR c++/55081
352 * typeck2.c (store_init_value): Call fold_non_dependent_expr
353 and maybe_constant_init even for C++98.
354
355 2012-10-26 Paolo Carlini <paolo.carlini@oracle.com>
356
357 PR c++/54984
358 * init.c (build_new): Don't turn a null *init into a pointer to
359 empty vector orig_init.
360
361 2012-10-25 Paolo Carlini <paolo.carlini@oracle.com>
362
363 PR c++/53761
364 * class.c (finish_struct_1): Reject aggregates decorated with
365 __transparent_union__ which cannot be made transparent because
366 the type of the first field has a different ABI from the class
367 overall.
368
369 2012-10-25 Jason Merrill <jason@redhat.com>
370
371 Core 1402
372 * call.c (joust): An implicitly deleted move function is
373 worse than any non-deleted function.
374 * method.c (process_subob_fn): No special rules for move.
375 (synthesized_method_walk, implicitly_declare_fn): Likewise.
376 Warn about virtual base with non-trivial move assignment.
377 * cp-tree.h (struct lang_decl_fn): Remove suppress_implicit_decl.
378 (FNDECL_SUPPRESS_IMPLICIT_DECL): Remove.
379
380 * semantics.c (finish_omp_threadprivate): Call complete_type.
381
382 * class.c (one_inherited_ctor): Warn about variadic inherited ctor.
383
384 2012-10-25 Marc Glisse <marc.glisse@inria.fr>
385
386 PR c++/54427
387 * typeck.c (build_x_conditional_expr): Handle VEC_COND_EXPR.
388 * call.c (build_conditional_expr_1): Likewise.
389
390 2012-10-25 Paolo Carlini <paolo.carlini@oracle.com>
391
392 PR c++/34892
393 * parser.c (cp_parser_template_parameter): When
394 cp_parser_parameter_declaration parsed a default argument don't
395 see if *is_parameter_pack needs setting.
396
397 2012-10-23 Paolo Carlini <paolo.carlini@oracle.com>
398
399 PR c++/54922
400 * semantics.c (cx_check_missing_mem_inits): Handle anonymous union
401 members.
402
403 2012-10-23 Jakub Jelinek <jakub@redhat.com>
404
405 PR c++/54844
406 * pt.c (tsubst_copy, tsubst_copy_and_build) <case SIZEOF_EXPR>: Use
407 tsubst instead of tsubst_copy* on types.
408
409 PR c++/54988
410 * decl2.c (cplus_decl_attributes): Don't return early
411 if attributes is NULL.
412
413 2012-10-18 Paolo Carlini <paolo.carlini@oracle.com>
414
415 PR c++/54501
416 * decl.c (reshape_init_array_1): Avoid infinite loops.
417
418 2012-10-15 Alexandre Oliva <aoliva@redhat.com>
419 Paolo Carlini <paolo.carlini@oracle.com>
420
421 PR c++/17805
422 * call.c (build_new_op_1): Filter out operator functions that don't
423 satisfy enum-conversion match requirements.
424
425 2012-10-15 Paolo Carlini <paolo.carlini@oracle.com>
426
427 PR c++/50080 (again)
428 * parser.c (cp_parser_optional_template_keyword): When -pedantic
429 and C++98 mode restore pre-Core/468 behavior.
430
431 2012-10-15 Paolo Carlini <paolo.carlini@oracle.com>
432
433 PR c++/50080
434 * parser.c (cp_parser_optional_template_keyword): Implement
435 Core/468, allow outside template.
436
437 2012-10-14 Jason Merrill <jason@redhat.com>
438 Ville Voutilainen <ville.voutilainen@gmail.com>
439
440 Implement C++11 inheriting constructors.
441 * cp-tree.h (cpp0x_warn_str): Add CPP0X_INHERITING_CTORS.
442 (DECL_INHERITED_CTOR_BASE, SET_DECL_INHERITED_CTOR_BASE): New.
443 (special_function_kind): Add sfk_inheriting_constructor.
444 * class.c (add_method): An inheriting ctor is hidden by a
445 user-declared one.
446 (one_inheriting_sig, one_inherited_ctor): New.
447 (add_implicitly_declared_members): Handle inheriting ctors.
448 * error.c (maybe_warn_cpp0x): Handle CPP0X_INHERITING_CTORS.
449 * init.c (emit_mem_initializers): Don't set LOOKUP_DEFAULTED
450 for an inheriting constructor.
451 * method.c (type_has_trivial_fn): Handle sfk_inheriting_constructor.
452 (type_set_nontrivial_flag): Likewise.
453 (add_one_base_init): Split out from...
454 (do_build_copy_constructor): ...here. Handle inheriting constructors.
455 (locate_fn_flags): Handle a list of arg types.
456 (synthesized_method_walk): Handle inheriting constructors.
457 (maybe_explain_implicit_delete): Likewise.
458 (deduce_inheriting_ctor): New.
459 (implicitly_declare_fn): Handle inheriting constructors.
460 * name-lookup.c (push_class_level_binding_1): An inheriting constructor
461 does not declare the base's name.
462 (do_class_using_decl): Allow inheriting constructors.
463 * pt.c (template_parms_to_args): Split from current_template_args.
464 (add_inherited_template_parms): New.
465 (tsubst_decl): Handle inheriting constructors.
466 * tree.c (special_function_p): Handle inheriting constructors.
467
468 2012-10-12 Jakub Jelinek <jakub@redhat.com>
469
470 PR c/54381
471 * semantics.c (finish_call_expr): Pass array of 3 sizeof_arg
472 trees and locs (corresponding to first 3 arguments) to
473 sizeof_pointer_memaccess_warning.
474
475 2012-10-12 Paolo Carlini <paolo.carlini@oracle.com>
476
477 PR c++/24449
478 * decl.c (grokfndecl): When checking for ::main declarations
479 use PROCESSING_REAL_TEMPLATE_DECL_P().
480
481 2012-10-12 Marc Glisse <marc.glisse@inria.fr>
482
483 PR c++/53055
484 * call.c (build_new_op_1): Pass RO_ARROW_STAR to cp_build_indirect_ref.
485 * typeck.c (cp_build_indirect_ref): Handle RO_ARROW_STAR.
486
487 2012-10-11 Jason Merrill <jason@redhat.com>
488
489 * cp-tree.h (DECL_THUNKS): NULL_TREE for non-virtual functions.
490 (SET_DECL_THUNKS): New.
491 * decl.c (duplicate_decls): Adjust.
492 * method.c (make_thunk): Adjust.
493
494 * decl.c (grokdeclarator): Set DECL_GNU_TLS_P for static data
495 members, too.
496
497 2012-10-09 Dodji Seketeli <dodji@redhat.com>
498
499 PR c++/53540 - using fails to be equivalent to typedef
500 * cp-tree.h (TYPE_TEMPLATE_INFO): For an alias that is not an
501 instance of alias template, don't look for its TEMPLATE_INFO in
502 its declaration.
503 (alias_template_specialization_p): Take const_tree.
504 * pt.c (alias_template_specialization_p): Take a const_tree.
505 Don't call primary_template_instantiation_p.
506 (primary_template_instantiation_p): Call
507 alias_template_specialization_p.
508
509 2012-10-10 Dodji Seketeli <dodji@redhat.com>
510
511 * parser (cp_parser_statement): Parse c++11 attributes
512 tentatively.
513 (cp_parser_std_attribute_spec_seq): Do not warn too early about
514 using c++11 attributes in non c++11 mode.
515
516 2012-10-10 Dehao Chen <dehao@google.com>
517
518 * cp-gimplify.c (cp_genericize_r): Set location for TRY expr.
519
520 2012-10-09 Lawrence Crowl <crowl@google.com>
521
522 * Make-lang.in (class.o): Add dependence on hash-table.h.
523 (tree.o): Likewise.
524 (semantics.o): Likewise.
525 * class.c (fixed_type_or_null): Change to new type-safe hash table.
526 * tree.c (verify_stmt_tree): Likewise.
527 (verify_stmt_tree_r): Likewise.
528 * semantics.c (struct nrv_data): Likewise.
529
530 2012-10-09 Paolo Carlini <paolo.carlini@oracle.com>
531
532 PR c++/54194
533 * typeck.c (build_x_binary_op): Update warn_about_parentheses call.
534 * parser.c (cp_parser_binary_expression): Use SET_EXPR_LOCATION
535 on current.lhs.
536
537 2012-10-09 Marc Glisse <marc.glisse@inria.fr>
538
539 PR c++/54427
540 * typeck.c (cp_build_binary_op): Handle mixed scalar-vector
541 operations.
542 [LSHIFT_EXPR, RSHIFT_EXPR]: Likewise.
543
544 2012-10-08 Jakub Jelinek <jakub@redhat.com>
545
546 PR c++/54858
547 * tree.c (cp_tree_equal): Handle FIELD_DECL.
548
549 2012-10-08 Jason Merrill <jason@redhat.com>
550
551 Allow dynamic initialization of thread_locals.
552 * decl.c: Define tls_aggregates.
553 (expand_static_init): Remove sorry. Add to tls_aggregates.
554 * cp-tree.h: Declare tls_aggregates.
555 * call.c (set_up_extended_ref_temp): Add to tls_aggregates.
556 * decl2.c (var_needs_tls_wrapper): New.
557 (var_defined_without_dynamic_init): New.
558 (get_tls_init_fn, get_tls_wrapper_fn): New.
559 (generate_tls_wrapper, handle_tls_init): New.
560 (cp_write_global_declarations): Call handle_tls_init and
561 enerate_tls_wrapper.
562 * mangle.c (write_guarded_var_name): Split out from..
563 (mangle_guard_variable): ...here.
564 (mangle_tls_init_fn, mangle_tls_wrapper_fn): Use it.
565 (decl_tls_wrapper_p): New.
566 * semantics.c (finish_id_expression): Replace use of thread_local
567 variable with a call to its wrapper.
568
569 * decl.c (get_thread_atexit_node): New.
570 (register_dtor_fn): Use it for TLS.
571
572 Partial implementation of C++11 thread_local.
573 * decl.c (cp_finish_decl): Remove errors about non-trivial
574 initialization and destruction of TLS variables.
575 (register_dtor_fn): Add sorry about TLS variables.
576 (expand_static_init): Add sorry about non-local TLS variables,
577 or error with __thread.
578 Don't emit thread-safety guards for local TLS variables.
579 (grokdeclarator): thread_local in a function implies static.
580 * decl.h: Adjust prototype.
581 * decl2.c (get_guard): Copy DECL_TLS_MODEL.
582 * parser.c (cp_parser_set_storage_class, cp_parser_set_decl_spec_type)
583 (set_and_check_decl_spec_loc): Take the token rather than the location.
584 Distinguish between __thread and thread_local.
585 (cp_parser_set_storage_class): Don't complain about thread_local before
586 extern/static.
587 (token_is__thread): New.
588 * call.c (make_temporary_var_for_ref_to_temp): Handle TLS.
589 * cp-tree.h (DECL_GNU_TLS_P): New.
590 (cp_decl_specifier_seq): Add gnu_thread_keyword_p.
591
592 2012-10-08 Dodji Seketeli <dodji@redhat.com>
593
594 PR c++/53528 C++11 attribute support
595 * cp-tree.h (enum cpp0x_warn_str::CPP0X_ATTRIBUTES): New member.
596 (enum cp_decl_spec::ds_std_attribute): New enumerator.
597 (struct cp_decl_specifier_seq::std_attributes): New field.
598 (cxx_alignas_expr, warn_misplaced_attr_for_class_type): Declare
599 new functions.
600 (check_tag_decl): Take an extra parameter for explicit
601 instantiations.
602 * decl.c (warn_misplaced_attr_for_class_type): Extract from ...
603 (check_tag_decl): ... here. Add check for c++11 attributes being
604 applied to an explicit instantiation. Take an extra parameter for
605 explicit instantiations.
606 (grokdeclarator): Make sure a c++11 attribute after an array
607 declarator appertains to the array, an attribute after a function
608 declarator appertains to the function type, an attribute after a
609 declarator-id appertains to the entity being declared, and an
610 attribute after a pointer declarator appertain to the pointer.
611 * decl2.c (is_late_template_attribute): Use get_attribute_name.
612 * error.c (maybe_warn_cpp0x): Support
613 CPP0X_GENERALIZED_ATTRIBUTES.
614 * parser.c (cp_next_tokens_can_be_attribute_p)
615 (cp_next_tokens_can_be_gnu_attribute_p)
616 (cp_next_tokens_can_be_std_attribute_p)
617 (cp_nth_tokens_can_be_attribute_p)
618 (cp_nth_tokens_can_be_gnu_attribute_p)
619 (cp_nth_tokens_can_be_std_attribute_p)
620 (cp_parser_gnu_attribute_list, cp_parser_std_attribute)
621 (cp_parser_std_attribute_spec, cp_parser_std_attribute_spec_seq)
622 (cp_parser_attributes_opt, cp_parser_std_attribute_list): New
623 static functions.
624 (cp_parser_gnu_attributes_opt): Replace cp_parser_attributes_opt.
625 (cp_parser_gnu_attribute_list): Replace cp_parser_attribute_list.
626 (cp_parser_postfix_expression): Disallow "[[" tokens here.
627 (cp_parser_label_for_labeled_statement): Use take an extra
628 parameter for attributes.
629 (cp_parser_block_declaration): Use
630 cp_nth_tokens_can_be_std_attribute_p here.
631 (cp_parser_decl_specifier_seq): Likewise. Store C++11 attributes
632 that appears in in decl specifiers in cp_decl_specifier_seq::std_attributes.
633 declaration. Emit proper warning about misplaced c++11 attributes
634 for class type.
635 (cp_parser_explicit_instantiation): Adjust call to check_tag_decl.
636 (cp_parser_init_declarator): Parsing attributes here is no more a
637 GNU extension in c++-11.
638 (cp_parser_type_specifier_seq): Use
639 cp_next_tokens_can_be_attribute_p.
640 (cp_parser_direct_declarator): Likewise. Hang c++11 attributes
641 following the declarator to its syntactic construct. It'll later
642 be applied to the proper appertaining entity by grokdeclarator.
643 (cp_parser_ptr_operator): Likewise.
644 (make_declarator): Initialize cp_declarator::std_attribute.
645 (make_pointer_declarator, make_reference_declarator)
646 (make_ptrmem_declarator, cp_parser_make_indirect_declarator): Take
647 attributes that appertain to the pointer/reference in argument.
648 (cp_parser_ptr_operator): Take an out parameter for c++11
649 attributes. Update comments.
650 (cp_parser_new_declarator_opt)
651 (cp_parser_conversion_declarator_opt): Adjust.
652 (cp_parser_declarator): Likewise. Handle C++11 attributes.
653 Rename attributes to gnu_attribute for better legibility.
654 (cp_parser_simple_declaration): Update comment.
655 (cp_parser_class_specifier_1): Parse GNU attributes specifically
656 (cp_parser_enum_specifier): Accept only gnu attributes after the
657 specifier.
658 (cp_parser_member_declaration): Don't clear attributes -- intended
659 for the entity being declared -- too early because check_tag_decl
660 needs them.
661 (cp_parser_statement): Update comment. Parse optional c++11
662 attributes at the beginning of the relevant kind of statements and
663 ignore them, for now, unless when calling
664 cp_parser_label_for_labeled_statement.
665 (cp_parser_label_for_labeled_statement): Take c++11 attributes
666 in parameter.
667 * semantics.c (potential_constant_expression_1): Likewise.
668 * typeck.c (fundamental_alignment_p, cxx_alignas_expr): New public
669 functions.
670
671 2012-10-07 Paolo Carlini <paolo.carlini@oracle.com>
672
673 * pt.c (fold_non_dependent_expr_sfinae): Remove static specifier.
674 (tsubst_copy_and_build): Use get_target_expr_sfinae.
675 * call.c (build_conditional_expr_1, convert_like_real): Likewise.
676 * cvt.c (build_up_reference): Likewise.
677 (ocp_convert): Use abstract_virtuals_error_sfinae.
678 (build_up_reference): Propagate complain to cp_build_addr_expr.
679 * decl.c (compute_array_index_type): Use fold_non_dependent_expr_sfinae.
680 * cp-tree.h: Update declarations.
681
682 * cvt.c (build_expr_type_conversion): Tidy.
683
684 * tree.c (stabilize_aggr_init): Change to static.
685
686 2012-10-07 Paolo Carlini <paolo.carlini@oracle.com>
687
688 PR c++/51422
689 * semantics.c (is_normal_capture_proxy): Return true for
690 error_mark_node as DECL_VALUE_EXPR.
691
692 2012-10-05 Jakub Jelinek <jakub@redhat.com>
693
694 * cp-tree.h (SIZEOF_EXPR_TYPE_P): Define.
695 * tree.c (cp_tree_equal): Handle SIZEOF_EXPR with
696 SIZEOF_EXPR_TYPE_P.
697 * mangle.c (write_expression): Likewise.
698 * cxx-pretty-print.c (pp_cxx_unary_expression): Likewise.
699 * error.c (dump_expr): Likewise.
700 * parser.c (cp_parser_unary_expression): For sizeof call
701 cxx_sizeof_or_alignof_{type,expr} just for diagnostics and
702 return SIZEOF_EXPR with the operand.
703 * pt.c (tsubst_copy, tsubst_copy_and_build): For SIZEOF_EXPR,
704 call cxx_sizeof_or_alignof_{type,expr} for diagnostics, but
705 return SIZEOF_EXPR with tsubsted operand.
706 (value_dependent_expression_p): Handle SIZEOF_EXPR with
707 SIZEOF_EXPR_TYPE_P.
708 (instantiation_dependent_r): Likewise.
709 * call.c (null_ptr_cst_p): Call maybe_constant_value for C++98.
710 * semantics.c (finish_call_expr): Call
711 sizeof_pointer_memaccess_warning if needed.
712 (cxx_eval_constant_expression): Handle SIZEOF_EXPR.
713 (potential_constant_expression_1): Remove early exit for
714 C++98. Handle PROPERTY_REF.
715 * decl.c (duplicate_decls): When redeclaring a builtin function,
716 keep the merged decl builtin also if newdecl is a gnu_inline
717 inline definition.
718 (fold_sizeof_expr_r): New function.
719 (compute_array_index_type): Fold SIZEOF_EXPRs in itype.
720 * cp-gimplify.c (cp_genericize_r): Fold SIZEOF_EXPR.
721 * typeck.c (cp_build_binary_op): For warn_for_sign_compare
722 try harder using maybe_constant_value to get INTEGER_CSTs.
723
724 * decl.c (stabilize_vla_size): Call pointer_set_destroy
725 at the end.
726
727 2012-10-04 Arnaud Charlet <charlet@adacore.com>
728
729 * decl2.c (cp_write_global_declarations): Fix handling of
730 -fdump-ada-spec*.
731
732 2012-10-03 Jakub Jelinek <jakub@redhat.com>
733
734 PR c++/54777
735 * semantics.c (cxx_eval_constant_expression) <case COMPOUND_EXPR>: If
736 not ignoring the second operand, pass the original second operand
737 and not one with stripped nops to cxx_eval_constant_expression.
738
739 2012-10-01 Jason Merrill <jason@redhat.com>
740
741 * decl.c (check_initializer): Set DECL_NONTRIVIALLY_INITIALIZED_P
742 for a constructor call.
743 (decl_jump_unsafe): So don't bother checking
744 type_has_nontrivial_default_init.
745 * call.c (set_up_extended_ref_temp): Set
746 DECL_NONTRIVIALLY_INITIALIZED_P.
747
748 * cp-tree.h (TYPE_FUNCTION_OR_TEMPLATE_DECL_CHECK): New.
749 (DECL_FRIEND_P, DECL_ANTICIPATED): Use it.
750 (TYPE_FUNCTION_OR_TEMPLATE_DECL_P): New.
751 * name-lookup.c (hidden_name_p): Use it.
752
753 * cp-tree.h (DECL_PRETTY_FUNCTION_P): Just look at the name.
754 * decl.c (cp_make_fname_decl): Adjust.
755
756 2012-09-30 Sharad Singhai <singhai@google.com>
757
758 * decl2.c (cp_write_global_declarations): Use a different method
759 to determine if the dump has ben initialized.
760
761 2012-09-29 Paolo Carlini <paolo.carlini@oracle.com>
762
763 PR c++/54738
764 * decl2.c (build_offset_ref_call_from_tree): Add tsubst_flags_t
765 parameter.
766 * pt.c (tsubst_copy_and_build): Adjust.
767 * parser.c (cp_parser_postfix_expression): Likewise.
768 * cp-tree.h: Adjust declaration.
769
770 2012-09-28 Dodji Seketeli <dodji@redhat.com>
771
772 PR c++/54372 - unused attribute inactive on dependant entities
773 * decl2.c (is_late_template_attribute): "unused" attribute is to
774 be applied at compile time.
775
776 2012-09-25 Dodji Seketeli <dodji@redhat.com>
777
778 PR c++/29028 - Missed unused warning on using declaration
779 * decl.c (poplevel<warn_unused*>): Do not forget that some local
780 bindings are represented by a TREE_LIST.
781
782 2012-09-25 Dodji Seketeli <dodji@redhat.com>
783
784 PR c++/53551 - -Wunused-local-typedefs misses uses
785 * decl.c (make_typename_type): Record the use of typedefs.
786
787 2012-09-27 Jakub Jelinek <jakub@redhat.com>
788
789 * init.c (build_new_1): Don't test TREE_CONSTANT
790 of INTEGER_CST.
791
792 2012-09-25 Paolo Carlini <paolo.carlini@oracle.com>
793
794 PR c++/54526
795 * parser.c (cp_parser_template_id): In C++11 mode simply accept
796 X<::A>.
797
798 2012-09-25 Zhenqiang Chen <zhenqiang.chen@linaro.org>
799
800 PR c++/50970
801 * typeck.c (cp_build_binary_op): Check side effects before generating
802 pfn and delta related expressions.
803
804 2012-09-24 Lawrence Crowl <crowl@google.com>
805
806 * init.c (build_new_1): Change to new double_int API.
807 * decl.c (build_enumerator): Likewise.
808 * typeck2.c (process_init_constructor_array): Likewise.
809 * mangle.c (write_array_type): Likewise.
810
811 2012-09-24 Paolo Carlini <paolo.carlini@oracle.com>
812
813 PR c++/50828
814 * error.c (dump_function_decl): Strip TFF_TEMPLATE_NAME from flags
815 at the outset.
816
817 2012-09-24 Jason Merrill <jason@redhat.com>
818
819 * decl.c (get_atexit_node): Remove dead code.
820
821 * Make-lang.in (cp/parser.o): Depend on decl.h.
822
823 2012-09-20 Paolo Carlini <paolo.carlini@oracle.com>
824
825 PR c++/52432
826 * pt.c (tsubst_copy_and_build): If tf_error is not set in the complain
827 argument don't call unqualified_name_lookup_error.
828
829 2012-09-19 Marc Glisse <marc.glisse@inria.fr>
830
831 PR c++/54581
832 * semantics.c (finish_decltype_type): Make vectors not opaque.
833
834 2012-09-17 Jason Merrill <jason@redhat.com>
835
836 PR c++/54575
837 * pt.c (instantiate_alias_template): New.
838 (tsubst): Use it.
839 (push_access_scope): Allow TYPE_DECL.
840
841 2012-09-14 Jason Merrill <jason@redhat.com>
842
843 PR c++/53661
844 * typeck2.c (check_narrowing): Avoid false positives on conversion
845 from enumeral type.
846
847 2012-09-14 Marc Glisse <marc.glisse@inria.fr>
848
849 PR c++/54427
850 * typeck.c (cp_build_binary_op) [LSHIFT_EXPR, RSHIFT_EXPR, EQ_EXPR,
851 NE_EXPR, LE_EXPR, GE_EXPR, LT_EXPR, GT_EXPR]: Handle VECTOR_TYPE.
852
853 2012-09-14 Paolo Carlini <paolo.carlini@oracle.com>
854
855 * decl.c (make_typename_type): Only error out if tf_error is set
856 in complain.
857
858 2012-09-13 Paolo Carlini <paolo.carlini@oracle.com>
859 Manuel López-Ibåñez <manu@gcc.gnu.org>
860
861 PR c++/53210
862 * init.c (perform_member_init): Use OPT_Winit_self instead of
863 OPT_Wuninitialized.
864
865 2012-09-13 Paolo Carlini <paolo.carlini@oracle.com>
866
867 * typeck.c (build_indirect_ref, build_function_call,
868 build_function_call_vec, build_binary_op, build_unary_op,
869 build_compound_expr, build_c_cast, build_modify_expr): Remove
870 uses of ATTRIBUTE_UNUSED on the parameters.
871 * class.c (set_linkage_according_to_type, resort_type_method_vec,
872 dfs_find_final_overrider_post, empty_base_at_nonzero_offset_p):
873 Likewise.
874 * decl.c (local_variable_p_walkfn): Likewise.
875 * except.c (wrap_cleanups_r, check_noexcept_r): Likewise.
876 * error.c (find_typenames_r): Likewise.
877 * tree.c (verify_stmt_tree_r, bot_replace,
878 handle_java_interface_attribute, handle_com_interface_attribute,
879 handle_init_priority_attribute, c_register_addr_space): Likewise.
880 * cp-gimplify.c (cxx_omp_clause_default_ctor): Likewise.
881 * cp-lang.c (objcp_tsubst_copy_and_build): Likewise.
882 * pt.c (unify_success, unify_invalid, instantiation_dependent_r):
883 Likewise.
884 * semantics.c (dfs_calculate_bases_pre): Likewise.
885 * decl2.c (fix_temporary_vars_context_r, clear_decl_external):
886 Likewise.
887 * parser.c (cp_lexer_token_at, cp_parser_omp_clause_mergeable,
888 cp_parser_omp_clause_nowait, cp_parser_omp_clause_ordered,
889 cp_parser_omp_clause_untied): Likewise.
890 * mangle.c (write_unnamed_type_name,
891 discriminator_for_string_literal): Likewise.
892 * search.c (dfs_accessible_post, dfs_debug_mark): Likewise.
893 * lex.c (handle_pragma_vtable, handle_pragma_unit,
894 handle_pragma_interface, handle_pragma_implementation,
895 handle_pragma_java_exceptions): Likewise.
896
897 2012-09-13 Jason Merrill <jason@redhat.com>
898
899 PR c++/53839
900 * semantics.c (cxx_eval_indirect_ref): If we aren't looking for an
901 address, make sure the value is constant.
902
903 PR c++/54511
904 * pt.c (tsubst_decl) [VAR_DECL]: Handle DECL_ANON_UNION_VAR_P.
905
906 PR c++/53836
907 * pt.c (value_dependent_expression_p): A TREE_LIST initializer must
908 be dependent.
909
910 2012-09-10 Paolo Carlini <paolo.carlini@oracle.com>
911
912 PR c++/54541
913 PR c++/54542
914 * call.c (build_cxx_call): Add tsubst_flags_t parameter, use
915 require_complete_type_sfinae.
916 (build_op_delete_call, build_over_call): Adjust.
917 * typeck.c (build_x_compound_expr_from_vec): Add tsubst_flags_t
918 parameter.
919 (cp_build_function_call_vec): Adjust.
920 * init.c (build_new_1): Likewise.
921 * rtti.c (throw_bad_cast, throw_bad_typeid, build_dynamic_cast_1):
922 Likewise.
923 * optimize.c (build_delete_destructor_body): Likewise.
924 * cp-tree.h: Adjust declarations.
925
926 * call.c (convert_arg_to_ellipsis): Use require_complete_type_sfinae.
927
928 2012-09-10 Jason Merrill <jason@redhat.com>
929
930 PR c++/54538
931 PR c++/53783
932 * pt.c (tsubst_copy_and_build) [LAMBDA_EXPR]: Go back to using RECUR
933 for LAMBDA_EXPR_EXTRA_SCOPE except for function scope.
934
935 PR c++/54506
936 * decl.c (move_signature_fn_p): Split out from move_fn_p.
937 * method.c (process_subob_fn): Use it.
938 * cp-tree.h: Declare it.
939
940 2012-09-07 Jason Merrill <jason@redhat.com>
941
942 * semantics.c (sort_constexpr_mem_initializers): Tweak.
943
944 2012-09-09 Mark Kettenis <kettenis@openbsd.org>
945
946 * decl.c (reshape_init_class): Avoid dereferencing a
947 past-the-end pointer.
948
949 2012-09-07 Paolo Carlini <paolo.carlini@oracle.com>
950
951 * pt.c (num_template_headers_for_class): Rework per the code
952 inline in cp_parser_check_declarator_template_parameters.
953 * parser.c (cp_parser_check_declarator_template_parameters):
954 Use num_template_headers_for_class.
955
956 2012-09-06 Jason Merrill <jason@redhat.com>
957
958 PR c++/54341
959 PR c++/54253
960 * semantics.c (sort_constexpr_mem_initializers): New.
961 (build_constexpr_constructor_member_initializers): Use it.
962 (cx_check_missing_mem_inits): Skip artificial fields.
963 * init.c (expand_aggr_init_1): Don't zero out a class
964 with no data.
965
966 2012-09-05 Paolo Carlini <paolo.carlini@oracle.com>
967
968 PR c++/54191
969 * search.c (lookup_base): Add tsubst_flags_t parameter.
970 (adjust_result_of_qualified_name_lookup, check_final_overrider):
971 Adjust.
972 * name-lookup.c (do_class_using_decl): Adjust.
973 * typeck2.c (binfo_or_else, build_scoped_ref, build_m_component_ref):
974 Likewise.
975 * cvt.c (cp_convert_to_pointer, convert_to_pointer_force,
976 build_up_reference): Likewise.
977 * rtti.c (build_dynamic_cast_1): Likewise.
978 * tree.c (maybe_dummy_object): Likewise.
979 * call.c (build_conditional_expr_1, build_over_call): Likewise.
980 * cp-tree.h (UNIQUELY_DERIVED_FROM_P, PUBLICLY_UNIQUELY_DERIVED_P):
981 Remove.
982 (enum base_access_flags, ba_quiet): Remove.
983 (uniquely_derived_from_p, publicly_uniquely_derived_p): Declare.
984 * except.c (can_convert_eh): Adjust.
985 * decl.c (grokdeclarator): Likewise.
986 * typeck.c (comp_except_types, build_class_member_access_expr,
987 finish_class_member_access_expr, get_member_function_from_ptrfunc,
988 build_static_cast_1, get_delta_difference_1): Likewise.
989 * class.c (build_base_path, convert_to_base, build_vtbl_ref_1,
990 warn_about_ambiguous_bases): Likewise.
991 (uniquely_derived_from_p, publicly_uniquely_derived_p): Define.
992
993 2012-09-04 Jason Merrill <jason@redhat.com>
994
995 PR c++/54441
996 * decl.c (reshape_init_class): Handle invalid initializer for
997 0-length array member.
998
999 * error.c (dump_type_suffix): Correct handling of 0-length arrays.
1000
1001 PR c++/54420
1002 * cp-tree.h (LAMBDANAME_P): Remove.
1003 (LAMBDA_TYPE_P): Check CLASSTYPE_LAMBDA_EXPR instead.
1004 * cp-lang.c (cxx_dwarf_name): Likewise.
1005 * error.c (dump_aggr_type): Likewise.
1006 * semantics.c (begin_lambda_type): Set CLASSTYPE_LAMBDA_EXPR sooner.
1007
1008 PR c++/54198
1009 * decl.c (check_default_argument): Set cp_unevaluated_operand
1010 around call to perform_implicit_conversion_flags.
1011
1012 PR c++/54437
1013 PR c++/51213
1014 * pt.c (fn_type_unification): Call coerce_template_parms before
1015 entering substitution context.
1016
1017 2012-08-31 Paolo Carlini <paolo.carlini@oracle.com>
1018 Jason Merrill <jason@redhat.com>
1019
1020 PR c++/18747
1021 * pt.c (check_template_variable): New.
1022 (num_template_headers_for_class): Split out...
1023 * decl.c (grokdeclarator): ...from here.
1024 (start_decl): Remove redundant diagnostic.
1025 * cp-tree.h: Declare them
1026 * parser.c (cp_parser_single_declaration): Call check_template_variable.
1027
1028 2012-08-31 Ollie Wild <aaw@google.com>
1029
1030 PR c++/54197
1031 * call.c (extend_ref_init_temps_1): Handle COMPOUND_EXPR trees.
1032
1033 2012-08-30 Jason Merrill <jason@redhat.com>
1034
1035 PR c++/50545
1036 PR c++/51222
1037 * pt.c (instantiation_dependent_r): New.
1038 (instantiation_dependent_expression_p): New.
1039 (value_dependent_expression_p): Use it. SCOPE_REF is always dependent.
1040 * semantics.c (finish_decltype_type): Use it.
1041 * cp-tree.h: Declare it.
1042
1043 * semantics.c (finish_qualified_id_expr): Handle building up a
1044 non-dependent SCOPE_REF here.
1045 (finish_id_expression): Not here.
1046 * error.c (dump_decl) [SCOPE_REF]: Only pass TFF_UNQUALIFIED_NAME.
1047
1048 * friend.c (make_friend_class): Handle template template parameters.
1049 * parser.c (cp_parser_template_declaration_after_export): Likewise.
1050 * pt.c (tsubst_friend_class): Likewise.
1051 (instantiate_class_template_1): Likewise
1052 * decl.c (check_elaborated_type_specifier): Likewise.
1053 (lookup_and_check_tag): Likewise.
1054
1055 * pt.c (get_class_bindings): Call coerce_template_parms. Add
1056 main_tmpl parameter.
1057 (more_specialized_class): Add main_tmpl parameter.
1058 (most_specialized_class): Adjust calls.
1059
1060 * decl.c (cp_finish_decl): Check for invalid multiple initializers
1061 even if the initializer is dependent.
1062
1063 * pt.c (instantiate_template_1): Keep processing_template_decl set
1064 if there are dependent args.
1065
1066 2012-08-25 Paolo Carlini <paolo.carlini@oracle.com>
1067
1068 PR c++/51421
1069 * decl2.c (mark_used): Consistently return false after errors
1070 about uses before deduction of auto.
1071 * semantics.c (finish_id_expression): Check mark_used return
1072 value and return error_mark_node in case of failure.
1073
1074 2012-08-24 Jason Merrill <jason@redhat.com>
1075
1076 PR c++/51213 (again)
1077 * pt.c (deduction_tsubst_fntype): Remove.
1078 (fn_type_unification): Check deduction depth and call
1079 instantiate_template here. Handle default argument access checks.
1080 (determine_specialization): Suppress access control.
1081 (tsubst_decl): Check for excessive deduction depth.
1082 (recheck_decl_substitution): Make sure access control is on.
1083 (type_unification_real): Don't mess with access deferring here.
1084 (get_bindings): Adjust for fn_type_unification return type.
1085 * call.c (enum rejection_reason_code): Drop rr_template_instantiation.
1086 (template_instantiation_rejection): Remove.
1087 (struct rejection_reason): Change targs to num_targs.
1088 (template_unification_rejection, print_z_candidate): Adjust.
1089 (add_template_candidate_real): Adjust for fn_type_unification change.
1090 * class.c (resolve_address_of_overloaded_function): Likewise.
1091 * cp-tree.h: Adjust declaration.
1092
1093 * pt.c (tsubst_default_argument): Indicate where the default
1094 argument is being instantiated for.
1095 (tsubst_expr): Restore previous location.
1096 (tsubst_copy_and_build): Set and restore location.
1097 * call.c (build_new_method_call_1): Remember location of call.
1098 * semantics.c (finish_call_expr): Here too.
1099 * parser.c (cp_parser_omp_for_loop): Remember the location of the
1100 increment expression.
1101
1102 * pt.c (resolve_overloaded_unification): Use coerce_template_parms
1103 instead of get_bindings.
1104 (resolve_nondeduced_context): Likewise.
1105
1106 * pt.c (register_specialization): Correct argument to
1107 check_specialization_namespace.
1108 (determine_specialization): Don't consider members of
1109 unspecialized types.
1110
1111 2012-08-23 Jason Merrill <jason@redhat.com>
1112
1113 * decl.c (compute_array_index_type): Use type_dependent_expression_p.
1114
1115 2012-08-23 Paolo Carlini <paolo.carlini@oracle.com>
1116
1117 PR c++/20420
1118 * name-lookup.c (supplement_binding_1): Handle specially enums
1119 only in class templates.
1120 (validate_nonmember_using_decl): Enforce 7.3.3/10 about duplicate
1121 using declarations at function scope.
1122
1123 2012-08-21 Richard Guenther <rguenther@suse.de>
1124
1125 * cp-tree.h (TREE_INDIRECT_USING): Use TREE_LANG_FLAG_0 accessor.
1126 (ATTR_IS_DEPENDENT): Likewise.
1127 (ARGUMENT_PACK_INCOMPLETE_P): Use TREE_ADDRESSABLE instead of
1128 TREE_LANG_FLAG_0 on TREE_VECs.
1129
1130 2012-08-20 Florian Weimer <fweimer@redhat.com>
1131
1132 PR c++/19351
1133 * call.c (build_operator_new_call): Add size_check argument and
1134 evaluate it.
1135 * cp-tree.h (build_operator_new_call): Adjust declaration.
1136 * init.c (build_new_1): Compute array size check and apply it.
1137
1138 2012-08-20 Paolo Carlini <paolo.carlini@oracle.com>
1139
1140 PR c++/10416
1141 * decl.c (poplevel): Check TYPE_HAS_NONTRIVIAL_DESTRUCTOR for
1142 Wunused_variable too.
1143
1144 2012-08-20 Diego Novillo <dnovillo@google.com>
1145
1146 * decl.c (poplevel): Start TV_NAME_LOOKUP conditionally.
1147
1148 2012-08-20 Richard Guenther <rguenther@suse.de>
1149
1150 * name-lookup.c (store_binding_p): New predicate, split out from ...
1151 (store_binding): ... here. Always store binding and require
1152 target vector with enough space.
1153 (store_bindings): Collect to store bindings and reserve space
1154 for them, then store them.
1155 (store_class_bindings): Likewise.
1156
1157 2012-08-19 Mikael Morin <mikael@gcc.gnu.org>
1158
1159 * Make-lang.in: Fix typo.
1160
1161 2012-08-17 Jakub Jelinek <jakub@redhat.com>
1162
1163 * cp-tree.def (SIZEOF_EXPR): Move to c-common.def.
1164
1165 2012-08-14 Diego Novillo <dnovillo@google.com>
1166
1167 Merge from cxx-conversion branch. Re-write VEC in C++.
1168
1169 * call.c (add_function_candidate): Remove const qualifier
1170 from call to VEC_index.
1171
1172 2012-08-10 Richard Guenther <rguenther@suse.de>
1173
1174 * error.c (dump_expr): Handle anonymous SSA names.
1175
1176 2012-08-07 Steven Bosscher <steven@gcc.gnu.org>
1177
1178 * error.c (print_instantiation_context): Pretty-print a newline before
1179 diagnostic_flush_buffer.
1180 * cxx-pretty-print.c (pp_cxx_function_definition): Use
1181 pp_newline_and_flush instead of separate pp_newline and pp_flush.
1182
1183 2012-08-06 Dodji Seketeli <dodji@redhat.com>
1184
1185 Avoid crashing on erroneous static_assert usage
1186 * semantics.c (finish_static_assert): Don't crash on erroneous
1187 message or condition.
1188
1189 2012-08-06 Marc Glisse <marc.glisse@inria.fr>
1190 Paolo Carlini <paolo.carlini@oracle.com>
1191
1192 PR c++/54165
1193 * typeck.c (build_static_cast_1): Move the conversion to void case
1194 before the perform_direct_initialization_if_possible call.
1195
1196 2012-08-03 Marc Glisse <marc.glisse@inria.fr>
1197
1198 * pt.c (tsubst_copy_and_build): Handle VECTOR_TYPE like scalars.
1199 * cp-tree.h (scalarish_type_p): Declare.
1200 * tree.c (scalarish_type_p): Make non-static.
1201
1202 2012-08-02 Jason Merrill <jason@redhat.com>
1203 Paolo Carlini <paolo.carlini@oracle.com>
1204
1205 PR c++/51213 (again)
1206 * pt.c (type_unification_real): Call push_deferring_access_checks /
1207 pop_deferring_access_checks around the substitution of default
1208 template args.
1209 (instantiate_template_1): When the specialization returned by
1210 retrieve_specialization has FNDECL_HAS_ACCESS_ERRORS set and we
1211 are in a SFINAE context, simply return error_mark_node.
1212 * cp-tree.h (FNDECL_RECHECK_ACCESS_P): Rename FNDECL_HAS_ACCESS_ERRORS.
1213
1214 2012-07-31 Paolo Carlini <paolo.carlini@oracle.com>
1215
1216 * pt.c (check_default_tmpl_args): Change is_primary and is_partial
1217 parameters to bool type, adjust.
1218 (push_template_decl_real): Tidy.
1219 * parser.c (cp_parser_init_declarator): Adjust.
1220 * decl.c (redeclaration_error_message): Likewise.
1221 * cp-tree.h (check_default_tmpl_args): Update prototype.
1222
1223 2012-07-31 Paolo Carlini <paolo.carlini@oracle.com>
1224
1225 PR c++/53624
1226 * pt.c (check_default_tmpl_args): Don't check local types.
1227
1228 2012-07-25 Sandra Loosemore <sandra@codesourcery.com>
1229 Paul Brook <paul@codesourcery.com>
1230
1231 PR target/53633
1232 * decl.c (finish_function): Check targetm.warn_func_return.
1233
1234 2012-07-25 Jason Merrill <jason@redhat.com>
1235
1236 PR c++/54086
1237 * decl.c (grokdeclarator): Allow const and constexpr together.
1238
1239 PR c++/54020
1240 * semantics.c (potential_constant_expression_1) [COND_EXPR]: Call
1241 maybe_constant_value.
1242
1243 * cp-tree.h (tsubst_flags): Remove tf_no_access_control.
1244 * call.c (standard_conversion): Don't set it.
1245 * class.c (resolve_address_of_overloaded_function): Don't check it.
1246 * decl.c (check_default_argument): Call
1247 perform_implicit_conversion_flags.
1248
1249 * pt.c (print_candidates_1): Use inform instead of error.
1250
1251 2012-07-24 Paolo Carlini <paolo.carlini@oracle.com>
1252
1253 * pt.c (convert_template_argument, tsubst): Simplify fourth argument
1254 to make_typename_type (complain & tf_error -> complain).
1255
1256 2012-07-24 Steven Bosscher <steven@gcc.gnu.org>
1257
1258 * class.c (n_vtables, n_vtable_entries, n_vtable_searches,
1259 n_vtable_elems, n_convert_harshness, n_compute_conversion_costs,
1260 n_inner_fields_searched): Always define.
1261 (build_primary_vtable): Convert #ifdef GATHER_STATISTICS to if-code.
1262 (print_class_statistics): Convert #ifdef GATHER_STATISTICS to if-code.
1263 * tree.c (depth_reached): Always define global.
1264 (cxx_print_statistics): Convert #ifdef GATHER_STATISTICS to if-code.
1265 * pt.c (depth_reached): Always define.
1266 (push_tinst_level): Convert #ifdef GATHER_STATISTICS to if-code.
1267 * search.c (n_fields_searched, n_calls_lookup_field,
1268 n_calls_lookup_field_1, n_calls_lookup_fnfields,
1269 n_calls_lookup_fnfields_1, n_calls_get_base_type,
1270 n_outer_fields_searched, n_contexts_saved): Always define.
1271 (lookup_field_1): Convert #ifdef GATHER_STATISTICS to if-code.
1272 (lookup_member): Likewise.
1273 (lookup_fnfields_idx_nolazy): Likewise.
1274 (print_search_statistics): Likewise.
1275 (reinit_search_statistics): Unconditionally re-set counters.
1276 * lex.c (retrofit_lang_decl): Convert #ifdef GATHER_STATISTICS
1277 to if-code.
1278 (cxx_dup_lang_specific_decl): Likewise.
1279 (copy_lang_type): Likewise.
1280 (cxx_make_type): Likewise.
1281
1282 2012-07-20 Jason Merrill <jason@redhat.com>
1283
1284 PR c++/54038
1285 * tree.c (build_cplus_array_type): Use build_cplus_array_type to build
1286 canonical array type rather than mess with its TYPE_*_VARIANT.
1287
1288 2012-07-19 Jason Merrill <jason@redhat.com>
1289
1290 PR c++/54026
1291 * typeck.c (cp_apply_type_quals_to_decl): Check COMPLETE_TYPE_P.
1292
1293 PR c++/54021
1294 * call.c (build_cxx_call): Set optimize when folding
1295 __builtin_constant_p in a constexpr function.
1296
1297 2012-07-18 Jason Merrill <jason@redhat.com>
1298
1299 * pt.c (instantiate_decl): Don't recheck substitutions.
1300
1301 2012-07-18 Paolo Carlini <paolo.carlini@oracle.com>
1302 Jason Merrill <jason@redhat.com>
1303
1304 DR 1170
1305 PR c++/51213
1306 * semantics.c (perform_access_checks): Add complain parm, return bool.
1307 (perform_deferred_access_checks): Likewise.
1308 (perform_or_defer_access_check): Likewise.
1309 (speculative_access_check): Remove.
1310 * call.c (enforce_access): Add complain parm, return bool.
1311 * decl.c, friend.c, class.c, init.c, parser.c: Adjust callers.
1312 * search.c: Adjust callers.
1313 * cp-tree.h (TINFO_RECHECK_ACCESS_P): New macro.
1314 (FNDECL_RECHECK_ACCESS_P): New macro.
1315 * method.c (synthesized_method_walk): Stop deferring access checks.
1316 * pt.c (recheck_decl_substitution): New.
1317 (instantiate_template_1): Set and check FNDECL_RECHECK_ACCESS_P.
1318
1319 2012-07-18 Jason Merrill <jason@redhat.com>
1320
1321 * method.c (process_subob_fn): Make sure no_implicit_p is non-null
1322 before trying to store through it.
1323
1324 2012-07-17 Jason Merrill <jason@redhat.com>
1325
1326 PR c++/53995
1327 * decl.c (finish_enum_value_list): Only call
1328 insert_late_enum_def_into_classtype_sorted_fields in class scope.
1329
1330 PR c++/53989
1331 * tree.c (build_cplus_array_type): Also add TYPE_CANONICAL
1332 to the list of variants.
1333
1334 * decl.c (xref_basetypes): Complain about incomplete template base.
1335 * class.c (finish_struct): Adjust variants in templates, too.
1336
1337 PR c++/53549
1338 * parser.c (cp_parser_class_head): Call xref_basetypes here.
1339 (cp_parser_class_specifier_1): Not here.
1340 * pt.c (tsubst_decl) [USING_DECL]: Check uses_template_parms
1341 as well as DECL_DEPENDENT_P.
1342
1343 2012-07-16 Jason Merrill <jason@redhat.com>
1344
1345 * cp-tree.h (struct deferred_access_check): Add location.
1346 * semantics.c (perform_access_checks): Use it.
1347 (perform_or_defer_access_check): Store it.
1348
1349 2012-07-16 Steven Bosscher <steven@gcc.gnu.org>
1350
1351 * dump.c (dump_stmt): Moved here from c-dump.c.
1352 * optimize.c: Include dumpfile.h instead of tree-dump.h.
1353 * class.c: Likewise.
1354 * decl2.c: Likewise.
1355 * Make-lang.in: Fix dependencies.
1356
1357 2012-07-13 Jason Merrill <jason@redhat.com>
1358
1359 PR c++/53953
1360 * method.c (synthesized_method_walk): Initialize no_implicit_p sooner.
1361
1362 2012-07-12 Jason Merrill <jason@redhat.com>
1363
1364 * pt.c (instantiate_decl): Check typedefs access here.
1365 (instantiate_template_1): Not here.
1366
1367 * pt.c (deduction_tsubst_fntype): Just suppress access checking.
1368 (instantiate_template_1): Set DECL_TI_TEMPLATE before access checking.
1369 (push_deduction_access_scope, pop_deduction_access_scope): Remove.
1370
1371 2012-07-11 Jason Merrill <jason@redhat.com>
1372
1373 DR 1402
1374 * method.c (synthesized_method_walk): Replace uses of msg with diag.
1375 Correct handling of virtual bases with move operations.
1376 (process_subob_fn, walk_field_subobs): Replace uses of msg with diag.
1377
1378 2012-07-11 Steven Bosscher <steven@gcc.gnu.org>
1379
1380 * method.c: Do not include tree-pass.h.
1381
1382 2012-07-10 Jason Merrill <jason@redhat.com>
1383
1384 DR 1402
1385 PR c++/53733
1386 * cp-tree.h (FNDECL_SUPPRESS_IMPLICIT_DECL): New.
1387 (struct lang_decl_fn): Add suppress_implicit_decl field.
1388 * method.c (implicitly_declare_fn): Check it.
1389 (process_subob_fn): Add no_implicit_p parm.
1390 (walk_field_subobs, synthesized_method_walk): Likewise.
1391 (maybe_explain_implicit_delete): Adjust.
1392 (explain_implicit_non_constexpr): Adjust.
1393
1394 * method.c (synthesized_method_walk): Avoid changing
1395 EH spec based on cleanups in other places, too.
1396
1397 2012-07-09 Sterling Augustine <saugustine@google.com>
1398
1399 * error.c (lang_decl_name): Use TFF_UNQUALIFIED_NAME flag.
1400
1401 2012-07-08 Steven Bosscher <steven@gcc.gnu.org>
1402
1403 * decl.c (cp_finish_decl): Add FIXME at add_local_decl call site.
1404
1405 2012-07-06 Jason Merrill <jason@redhat.com>
1406
1407 PR c++/53862
1408 * pt.c (tsubst_arg_types): Add "end" parameter.
1409 (check_undeduced_parms): Use it.
1410
1411 * cp-tree.h (DECL_DECLARES_TYPE_P): Check DECL_TYPE_TEMPLATE_P.
1412
1413 PR c++/53858
1414 * name-lookup.c (ambiguous_decl): Use DECL_TYPE_TEMPLATE_P.
1415
1416 2012-07-05 Jason Merrill <jason@redhat.com>
1417
1418 PR c++/53039
1419 * pt.c (arg_from_parm_pack_p): Go back to using same_type_p or
1420 cp_tree_equal.
1421
1422 * cp-tree.h (TEMPLATE_PARM_NUM_SIBLINGS): Remove.
1423 (struct template_parm_index_s): Remove num_siblings.
1424 * pt.c (fixup_template_parms, fixup_template_parm_index): Remove.
1425 (fixup_template_type_parm_type): Remove.
1426 (build_template_parm_index): Remove num_siblings parm.
1427 (process_template_parm): Likewise.
1428 * parser.c (cp_parser_template_parameter_list): Adjust.
1429 * tree.c (cp_tree_equal): Don't compare num_siblings.
1430 * typeck.c (comp_template_parms_position): Likewise.
1431
1432 PR c++/50852
1433 PR c++/53039
1434 * tree.c (strip_typedefs_expr): New.
1435 * cp-tree.h: Declare it.
1436 * pt.c (convert_template_argument, unify): Use it.
1437 * parser.c (cp_parser_template_declaration_after_export): Don't call
1438 fixup_template_parms.
1439
1440 2012-07-04 Jason Merrill <jason@redhat.com>
1441
1442 PR c++/53848
1443 PR c++/53524
1444 * decl.c (build_enumerator): Don't use build_lang_decl_loc.
1445
1446 2012-07-03 Jakub Jelinek <jakub@redhat.com>
1447
1448 PR c++/53812
1449 * semantics.c (finish_goto_stmt): Surround computed goto argument
1450 with CLEANUP_POINT_EXPR if needed.
1451
1452 2012-07-02 Jason Merrill <jason@redhat.com>
1453
1454 PR c++/53619
1455 * pt.c (in_template_function): New.
1456 * cp-tree.h: Declare it.
1457 * class.c (build_base_path, resolves_to_fixed_type_p): Use it.
1458
1459 PR c++/53783
1460 * pt.c (tsubst_copy_and_build) [LAMBDA_EXPR]: Use tsubst
1461 for LAMBDA_EXPR_EXTRA_SCOPE.
1462
1463 PR c++/53788
1464 * pt.c (build_non_dependent_expr): Don't wrap a dummy object.
1465
1466 PR c++/53816
1467 * class.c (resolves_to_fixed_type_p): Check uses_template_parms
1468 (current_function_decl) instead of processing_template_decl.
1469
1470 PR c++/53821
1471 * semantics.c (maybe_add_lambda_conv_op): Don't set
1472 DECL_INTERFACE_KNOWN.
1473
1474 PR c++/53524
1475 * call.c (build_conditional_expr_1): Don't warn about comparison of
1476 two enumerators before their enumeration is complete.
1477 (build_new_op_1): Call decay_conversion before warn_logical_operator.
1478 * decl.c (build_enumerator): Set DECL_CONTEXT of an enumerator to
1479 its enumeration.
1480 * decl2.c (mark_used): Call used_types_insert for enums.
1481 * semantics.c (finish_id_expression): Don't decay CONST_DECL.
1482 (finish_member_declaration): Don't change DECL_CONTEXT of enumerators.
1483 * class.c (check_field_decls): Don't change DECL_CONTEXT of enums.
1484 * typeck.c (convert_for_assignment): Don't decay CONST_DECL.
1485 (build_class_member_access_expr): Look through unscoped enums.
1486 * search.c (context_for_name_lookup): Look through unscoped enums.
1487 * pt.c (tsubst_copy_and_build): Don't decay CONST_DECL.
1488 (tsubst_copy): Use DECL_CONTEXT to find the enumeration.
1489 * tree.c (decl_linkage): Likewise.
1490 * cvt.c (ocp_convert): Check decayed expr for enum range warning.
1491
1492 2012-06-29 Steven Bosscher <steven@gcc.gnu.org>
1493
1494 * Make-lang.in: Remove tree-mudflap.o from CXX_AND_OBJCXX_OBJS.
1495
1496 2012-06-27 Jason Merrill <jason@redhat.com>
1497
1498 * parser.c (cp_parser_check_for_invalid_template_id): tag_type parm.
1499 (cp_parser_simple_type_specifier, cp_parser_class_head): Adjust.
1500 (cp_parser_elaborated_type_specifier): Adjust.
1501 * decl.c (duplicate_decls): Return error_mark_node on template
1502 mismatch.
1503
1504 PR c++/53563
1505 * parser.c (cp_parser_template_id): Add tag_type parm.
1506 (cp_parser_template_name): Likewise.
1507 (cp_parser_id_expression, cp_parser_unqualified_id): Adjust.
1508 (cp_parser_pseudo_destructor_name, cp_parser_type_name): Adjust.
1509 (cp_parser_simple_type_specifier, cp_parser_class_name): Adjust.
1510 (cp_parser_elaborated_type_specifier, cp_parser_class_head): Adjust.
1511
1512 2012-06-27 Ramana Radhakrishnan <ramana.radhakrishnan@linaro.org>
1513
1514 PR C++/51033
1515 * semantics.c (constexpr_call): Fix typo in comment.
1516 (cxx_eval_vec_perm_expr): New.
1517 (cxx_eval_constant_expression): Fold VEC_PERM_EXPRs.
1518
1519 2012-06-26 Richard Guenther <rguenther@suse.de>
1520
1521 PR c++/53752
1522 * mangle.c (write_array_type): Truncate the number-of-elements
1523 result.
1524
1525 2012-06-25 Jason Merrill <jason@redhat.com>
1526
1527 PR c++/53498
1528 PR c++/53305
1529 * pt.c (tsubst_decl) [PARM_DECL]: Don't recurse into DECL_CHAIN
1530 if cp_unevaluated_operand is set.
1531 (tsubst_copy) [PARM_DECL]: Don't copy before tsubsting.
1532
1533 PR c++/52988
1534 * typeck.c (decay_conversion): Don't discard side-effects from
1535 expressions of nullptr_t.
1536
1537 2012-06-25 Florian Weimer <fweimer@redhat.com>
1538
1539 * init.c (build_new_1): Warn about (T[N]) for variable N, and
1540 reject T[M][N].
1541
1542 * parser.c (cp_parser_direct_new_declarator): Accept non-constant
1543 expressions. Handled now in build_new_1.
1544
1545 2012-06-25 Jason Merrill <jason@redhat.com>
1546
1547 PR c++/53202
1548 * semantics.c (build_data_member_initialization): Always keep
1549 initializer for empty base.
1550 (cxx_eval_bare_aggregate): Discard it here.
1551
1552 PR c++/53565
1553 * pt.c (tsubst_omp_for_iterator): Simplify DECL_EXPR handling.
1554 (tsubst_expr) [OMP_FOR]: Here, too.
1555
1556 2012-06-25 Jakub Jelinek <jakub@redhat.com>
1557
1558 PR c++/53594
1559 * class.c (check_bases_and_members): Avoid -Wuninitialized
1560 diagnostics for non-static const members or references if they
1561 use NSDMI.
1562
1563 2012-06-16 Ville Voutilainen <ville.voutilainen@gmail.com>
1564
1565 * parser.c (cp_parser_direct_declarator): Move virt-specifier
1566 parsing after late-specified return type parsing.
1567
1568 2012-06-14 Jason Merrill <jason@redhat.com>
1569
1570 PR c++/53651
1571 * name-lookup.c (constructor_name_p): Don't try to look at the
1572 name of a DECLTYPE_TYPE.
1573
1574 2012-06-18 Lawrence Crowl <crowl@google.com>
1575
1576 * decl2.c (cp_write_global_declarations): Rename use of TV_PHASE_CGRAPH
1577 to TV_PHASE_OPT_GEN.
1578
1579 2012-06-18 Steven Bosscher <steven@gcc.gnu.org>
1580
1581 * decl.c (finish_function): Remove code conditional on VMS_TARGET.
1582
1583 2012-06-15 Marc Glisse <marc.glisse@inria.fr>
1584
1585 PR c++/51033
1586 * semantics.c (literal_type_p): Handle VECTOR_TYPE.
1587 (potential_constant_expression_1): Handle VEC_PERM_EXPR.
1588 * parser.c (cp_parser_postfix_expression): Handle RID_BUILTIN_SHUFFLE.
1589
1590 2012-06-09 Jason Merrill <jason@redhat.com>
1591
1592 * pt.c (tsubst_expr) [TAG_DEFN]: Instantiate local class.
1593 * class.c (finish_struct): Don't add a TAG_DEFN for a lambda.
1594 * decl2.c (finish_static_data_member_decl): Avoid redundant error.
1595
1596 PR c++/53599
1597 * name-lookup.c (pushtag_1): Add a DECL_EXPR for a local class.
1598 * semantics.c (finish_cond): Build a COMPOUND_EXPR.
1599 * pt.c (tsubst_expr) [COMPOUND_EXPR]: Handle.
1600 [DECL_EXPR]: Don't call cp_finish_decl for an implicit typedef.
1601 Don't return the decl.
1602
1603 2012-06-11 Richard Guenther <rguenther@suse.de>
1604
1605 PR c++/53605
1606 * mangle.c (write_array_type): Use double-ints for array domain
1607 arithmetic.
1608
1609 2012-06-07 Fabien ChĂȘne <fabien@gcc.gnu.org>
1610
1611 PR c++/51214
1612 * cp-tree.h (insert_late_enum_def_into_classtype_sorted_fields):
1613 Declare.
1614 * class.c (insert_into_classtype_sorted_fields): New.
1615 (add_enum_fields_to_record_type): New.
1616 (count_fields): Adjust the comment.
1617 (add_fields_to_record_type): Likewise.
1618 (finish_struct_1): Move the code that inserts the fields for the
1619 sorted case, into insert_into_classtype_sorted_fields, and call
1620 it.
1621 (insert_late_enum_def_into_classtype_sorted_fields): Define.
1622 * decl.c (finish_enum_value_list): Call
1623 insert_late_enum_def_into_classtype_sorted_fields if a late enum
1624 definition is encountered.
1625
1626 2012-06-06 Paolo Carlini <paolo.carlini@oracle.com>
1627
1628 PR c++/53567
1629 * typeck.c (cp_perform_integral_promotions): New, like
1630 perform_integral_promotions but also takes a tsubst_flags_t parameter.
1631 (pointer_diff): Add tsubst_flags_t parameter.
1632 (decay_conversion, cp_default_conversion, cp_build_array_ref,
1633 cp_build_binary_op, cp_build_unary_op, build_static_cast_1,
1634 build_reinterpret_cast_1, cp_build_modify_expr,
1635 convert_for_assignment): Adjust.
1636 * optimize.c (build_delete_destructor_body): Adjust.
1637 * init.c (expand_virtual_init, expand_default_init, build_new_1,
1638 build_new, build_vec_delete_1, build_vec_init, build_delete): Adjust.
1639 (construct_virtual_base): Adjust LOOKUP_COMPLAIN -> 0.
1640 * class.c (build_base_path): Adjust.
1641 * decl.c (compute_array_index_type, finish_destructor_body): Likewise.
1642 * method.c (synthesized_method_walk): Adjust flag and complain.
1643 * rtti.c (ifnonnull): Add tsubst_flags_t parameter.
1644 (build_typeid, build_dynamic_cast_1): Adjust.
1645 * except.c (initialize_handler_parm): Likewise.
1646 * typeck2.c (process_init_constructor_record): Likewise.
1647 * pt.c (tsubst_friend_class): Don't change flags.
1648 * semantics.c (finish_goto_stmt, handle_omp_for_class_iterator,
1649 finish_static_assert): Likewise.
1650 * parser.c (cp_parser_lookup_name): Just pass 0 as flags to
1651 lookup_name_real.
1652 * call.c (build_op_delete_call): Add tsubst_flags_t parameter.
1653 (convert_like_real, convert_arg_to_ellipsis, convert_for_arg_passing):
1654 Adjust.
1655 (standard_conversion): Adjust LOOKUP_COMPLAIN -> 0.
1656 (implicit_conversion): Mask out tf_error with a FIXME.
1657 (build_user_type_conversion_1, build_new_op_1, build_over_call): Use
1658 complain & tf_error instead of flags & LOOKUP_COMPLAIN.
1659 * cvt.c (cp_convert_to_pointer, convert_to_pointer_force,
1660 build_up_reference, convert_to_reference, cp_convert,
1661 cp_convert_and_check, ocp_convert, convert_force): Add tsubst_flags_t
1662 parameter.
1663 (convert_to_reference, ocp_convert): Use complain & tf_error instead
1664 of flags & LOOKUP_COMPLAIN.
1665 (convert_force): Adjust LOOKUP_COMPLAIN -> 0.
1666 * name-lookup.c (identifier_type_value_1, lookup_qualified_name,
1667 lookup_name_real, lookup_function_nonclass, lookup_name,
1668 lookup_name_prefer_type): Adjust LOOKUP_COMPLAIN -> 0.
1669 * cp-tree.h: Adjust prototypes; remove LOOKUP_COMPLAIN.
1670
1671 2012-06-06 Steven Bosscher <steven@gcc.gnu.org>
1672
1673 * decl.c: Do not include output.h.
1674 (start_decl): Remove code for flag_conserve_space.
1675
1676 2012-06-06 Fabien ChĂȘne <fabien@gcc.gnu.org>
1677
1678 PR c++/52841
1679 * parser.c (cp_parser_alias_declaration): Return earlier
1680 if an error occured.
1681
1682 2012-06-04 Paolo Carlini <paolo.carlini@oracle.com>
1683
1684 PR c++/53524
1685 * call.c (build_conditional_expr_1): Use OPT_Wenum_compare
1686 to control enumeral mismatch in conditional expression too.
1687
1688 2012-06-04 Sterling Augustine <saugustine@google.com>
1689
1690 * cp-tree.h: Declare decl_as_dwarf_string, lang_decl_dwarf_name.
1691 * cp-lang.c (cxx_dwarf_name): Call them.
1692
1693 2012-06-04 Steven Bosscher <steven@gcc.gnu.org>
1694
1695 * semantics.c: Do not include output.h.
1696 * decl2.c: Likewise.
1697 * friend.c: Likewise.
1698 * typeck.c: Likewise.
1699 * typeck2.c: Likewise.
1700 * Make-lang.in: Fix dependencies.
1701
1702 2012-06-01 Jason Merrill <jason@redhat.com>
1703
1704 PR c++/52973
1705 * parser.c (cp_parser_class_head): Apply attributes here.
1706 * semantics.c (begin_class_definition): Not here.
1707 * cp-tree.h: Adjust.
1708
1709 PR c++/52725
1710 * parser.c (cp_parser_binary_expression): Bail early if we're parsing
1711 tentatively and the LHS has a parse error.
1712
1713 PR c++/53137
1714 * pt.c (instantiate_class_template_1): Set LAMBDA_EXPR_THIS_CAPTURE.
1715 (instantiate_decl): Don't push_to_top_level for local class methods.
1716 (instantiate_class_template_1): Or for local classes.
1717
1718 PR c++/53484
1719 * pt.c (do_auto_deduction): Don't try to deduce from a
1720 type-dependent initializer.
1721
1722 2012-06-01 Paolo Carlini <paolo.carlini@oracle.com>
1723
1724 PR c++/26155
1725 * name-lookup.c (push_namespace): When error recovery is
1726 impossible just error out in duplicate_decls.
1727
1728 2012-05-31 Steven Bosscher <steven@gcc.gnu.org>
1729
1730 * call.c: Do not include output.h.
1731 * class.c: Likewise.
1732 * except.c: Likewise.
1733 * friend.c: Likewise.
1734 * init.c: Likewise.
1735 * lex.c: Likewise.
1736 * method.c: Likewise.
1737 * parser.c: Likewise.
1738 * pt.c: Likewise.
1739 * rtti.c: Likewise.
1740 * search.c: Likewise.
1741
1742 2012-05-30 Jason Merrill <jason@redhat.com>
1743
1744 PR c++/53356
1745 * tree.c (stabilize_init): Handle stabilizing a TARGET_EXPR
1746 representing a bitwise copy of a glvalue.
1747
1748 * tree.c (stabilize_expr): Tweak logic.
1749
1750 PR c++/53356
1751 * tree.c (stabilize_init): Side effects make the init unstable.
1752
1753 2012-05-28 Paolo Carlini <paolo.carlini@oracle.com>
1754
1755 PR c++/53503
1756 * semantics.c (potential_constant_expression_1): Handle LTGT_EXPR.
1757
1758 2012-05-26 Paolo Carlini <paolo.carlini@oracle.com>
1759
1760 PR c++/53491
1761 * tree.c (stabilize_expr): Handle exp of void type.
1762
1763 2012-05-26 Jason Merrill <jason@redhat.com>
1764
1765 PR c++/53220
1766 * call.c (convert_like_real) [ck_list]: Take array address directly.
1767 * typeck.c (decay_conversion): Reject decay of an array compound
1768 literal.
1769
1770 2012-05-25 Paolo Carlini <paolo.carlini@oracle.com>
1771
1772 PR c++/32054
1773 * parser.c (cp_parser_member_declaration): A storage class is not
1774 allowed in a declaration of an anonymous aggregate in a class scope.
1775
1776 2012-05-24 Uros Bizjak <ubizjak@gmail.com>
1777
1778 PR obj-c++/53441
1779 * decl.c (grokdeclarator): Check that current_class_type is non-NULL
1780 before calling constructor_name_p.
1781
1782 2012-05-24 Paolo Carlini <paolo.carlini@oracle.com>
1783
1784 PR c++/32080
1785 * parser.c (cp_parser_ctor_initializer_opt_and_function_body,
1786 cp_parser_function_body): Add a bool parameter, true when parsing
1787 a function-try-block.
1788 (cp_parser_function_try_block): Pass true to the above.
1789 (cp_parser_function_definition_after_declarator,
1790 cp_parser_function_transaction): Adjust.
1791
1792 2012-05-23 Paolo Carlini <paolo.carlini@oracle.com>
1793
1794 PR c++/29185
1795 * decl2.c (delete_sanity): Extend 'deleting array' warning to
1796 any array type.
1797
1798 2012-05-21 Paolo Carlini <paolo.carlini@oracle.com>
1799
1800 PR c++/51184
1801 * decl.c (grokdeclarator): Diagnose functions returning abstract
1802 class types as TYPENAME.
1803 * cp-tree.h (ABSTRACT_CLASS_TYPE_P): Add.
1804 * except.c (is_admissible_throw_operand_or_catch_parameter): Use it.
1805 * pt.c (tsubst): Likewise.
1806 * semantics.c (trait_expr_value): Likewise.
1807
1808 2012-05-21 Paolo Carlini <paolo.carlini@oracle.com>
1809
1810 PR c++/40821
1811 * parser.c (cp_parser_attributes_opt): Enforce error checking of
1812 unbalanced parentheses in the presence of tentative parsing.
1813
1814 2012-05-17 Paolo Carlini <paolo.carlini@oracle.com>
1815
1816 PR c++/39681
1817 * parser.c (cp_parser_new_type_id): Early return error_mark_node
1818 if the cp_parser_type_specifier_seq call has type_specifier_seq.type
1819 error_mark_node; tidy.
1820 (cp_parser_new_expression): Always initialize nelts to NULL_TREE to
1821 avoid uninitialized warnings.
1822 (cp_parser_init_declarator, cp_parser_late_parse_one_default_arg):
1823 Call cp_parser_skip_to_end_of_statement if cp_parser_initializer
1824 returns error_mark_node.
1825
1826 2012-05-17 Paolo Carlini <paolo.carlini@oracle.com>
1827
1828 PR c++/53371
1829 * except.c (is_admissible_throw_operand): Rename to
1830 is_admissible_throw_operand_or_catch_parameter and handle
1831 catch parameter too.
1832 (expand_start_catch_block): Use it.
1833 (build_throw): Adjust.
1834
1835 2012-05-17 Paolo Carlini <paolo.carlini@oracle.com>
1836
1837 PR c++/44516
1838 * typeck.c (build_x_array_ref, build_x_conditional_expr,
1839 build_x_compound_expr, build_x_modify_expr): Add location_t parameter.
1840 (finish_class_member_access_expr, build_x_indirect_ref,
1841 build_x_binary_op, build_x_compound_expr_from_list,
1842 build_x_compound_expr_from_vec): Adjust callers.
1843 * tree.c (build_min_nt_loc): New.
1844 (build_min_nt): Remove.
1845 * typeck2.c (build_x_arrow): Adjust callers.
1846 * pt.c (tsubst_qualified_id, tsubst_omp_for_iterator,
1847 tsubst_copy_and_build): Likewise.
1848 * semantics.c (finish_mem_initializers, handle_omp_for_class_iterator,
1849 finish_omp_atomic): Likewise.
1850 * decl2.c (grok_array_decl, build_anon_union_vars): Adjust.
1851 * parser.c (cp_parser_question_colon_clause,
1852 cp_parser_assignment_expression, cp_parser_expression,
1853 cp_parser_template_id, cp_parser_omp_for_loop): Likewise.
1854 * cp-tree.h: Update.
1855
1856 2012-05-16 Dodji Seketeli <dodji@redhat.com>
1857
1858 PR preprocessor/7263
1859 * cp-tree.h (enum cp_decl_spec): Add new enumerators to cover all
1860 the possible declarator specifiers so far.
1861 (struct cp_decl_specifier_seq::locations): Declare new member.
1862 (cp_decl_specifier_seq::{specs, type_location}): Remove.
1863 (decl_spec_seq_has_spec_p): Declare new function.
1864 * parser.c (cp_parser_check_decl_spec): Remove.
1865 (set_and_check_decl_spec_loc): Define new static function.
1866 (decl_spec_seq_has_spec_p): Define new public function.
1867 (cp_parser_decl_specifier_seq, cp_parser_function_specifier_opt)
1868 (cp_parser_type_specifier, cp_parser_simple_type_specifier)
1869 (cp_parser_set_storage_class, cp_parser_set_decl_spec_type)
1870 (cp_parser_alias_declaration): Set the locations for each
1871 declspec, using set_and_check_decl_spec_loc.
1872 (cp_parser_explicit_instantiation, cp_parser_init_declarator)
1873 (cp_parser_member_declaration, cp_parser_init_declarator): Use the
1874 new declspec location for specifiers. Use the new
1875 decl_spec_seq_has_spec_p.
1876 (cp_parser_type_specifier_seq): Use the new
1877 set_and_check_decl_spec_loc. Stop using
1878 cp_parser_check_decl_spec. Use the new decl_spec_seq_has_spec_p.
1879 (, cp_parser_init_declarator): Use the new
1880 set_and_check_decl_spec_loc.
1881 (cp_parser_single_declaration, cp_parser_friend_p)
1882 (cp_parser_objc_class_ivars, cp_parser_objc_struct_declaration):
1883 Use the new decl_spec_seq_has_spec_p.
1884 * decl.c (check_tag_decl): Use new decl_spec_seq_has_spec_p. Use
1885 the more precise ds_redefined_builtin_type_spec location for
1886 diagnostics about re-declaring C++ built-in types.
1887 (start_decl, grokvardecl, grokdeclarator): Use the new
1888 decl_spec_seq_has_spec_p.
1889
1890 2012-05-15 Paolo Carlini <paolo.carlini@oracle.com>
1891
1892 PR c++/11856
1893 * pt.c (tsubst_copy_and_build): Increase / decrease
1894 c_inhibit_evaluation_warnings around build_x_binary_op call.
1895
1896 2012-05-12 Paolo Carlini <paolo.carlini@oracle.com>
1897
1898 * cp-tree.h (TYPE_PTRMEM_P): Rename to TYPE_PTRDATAMEM_P.
1899 (TYPE_PTR_TO_MEMBER_P): Rename to TYPE_PTRMEM_P.
1900 (TYPE_PTR_OR_PTRMEM_P): Add.
1901 * typeck.c (composite_pointer_type_r, composite_pointer_type,
1902 common_pointer_type, cp_build_indirect_ref, cp_build_binary_op,
1903 cp_truthvalue_conversion, convert_ptrmem, build_static_cast_1,
1904 build_reinterpret_cast_1, build_const_cast_1, comp_ptr_ttypes_real,
1905 casts_away_constness_r, casts_away_constness): Adjust.
1906 * init.c (build_zero_init_1): Adjust.
1907 * class.c (check_field_decls): Likewise.
1908 * decl.c (check_default_argument): Likewise.
1909 * rtti.c (target_incomplete_p): Likewise.
1910 * tree.c (zero_init_p): Likewise.
1911 * cxx-pretty-print.c (pp_cxx_ptr_operator,
1912 pp_cxx_abstract_declarator): Likewise.
1913 * typeck2.c (build_m_component_ref): Likewise.
1914 * pt.c (convert_nontype_argument, invalid_nontype_parm_type_p,
1915 dependent_type_p_r): Likewise.
1916 * call.c (null_member_pointer_value_p, standard_conversion,
1917 add_builtin_candidate, build_conditional_expr_1, compare_ics):
1918 Likewise.
1919 * cp-objcp-common.c (cp_var_mod_type_p): Likewise.
1920 * cvt.c (cp_convert_to_pointer, ocp_convert,
1921 perform_qualification_conversions): Likewise.
1922 * mangle.c (write_type): Likewise.
1923 * name-lookup.c (arg_assoc_type): Likewise.
1924
1925 2012-05-12 Paolo Carlini <paolo.carlini@oracle.com>
1926
1927 * parser.c (struct cp_parser_expression_stack_entry): Add location_t
1928 field.
1929 (cp_parser_binary_expression): Rework to always update at the same
1930 time tree_type and loc.
1931 * call.c (print_z_candidate): Add location_t parameter.
1932 (print_z_candidates, convert_like_real, joust): Adjust.
1933
1934 2012-05-11 Alexandre Oliva <aoliva@redhat.com>
1935
1936 PR c++/53209
1937 * pt.c (tsubst_decl): Bail out if argvec is error_mark_node.
1938
1939 2012-05-11 Paolo Carlini <paolo.carlini@oracle.com>
1940
1941 PR c++/53305
1942 * pt.c (tsubst_copy: case PARM_DECL): Return error_mark_node if
1943 tsubst_decl returns NULL_TREE.
1944 * cxx-pretty-print.c (pp_cxx_simple_type_specifier): Handle
1945 BOUND_TEMPLATE_TEMPLATE_PARM.
1946
1947 2012-05-10 Paolo Carlini <paolo.carlini@oracle.com>
1948
1949 PR c++/53158
1950 * cvt.c (ocp_convert): Error out early for void -> bool conversions.
1951 * typeck.c (decay_conversion): Use error_at.
1952 * call.c (build_integral_nontype_arg_conv, convert_like_real,
1953 convert_arg_to_ellipsis, perform_implicit_conversion_flags,
1954 initialize_reference): Likewise.
1955 * cvt.c (warn_ref_binding): Add location_t parameter.
1956 (cp_convert_to_pointer, convert_to_reference, ocp_convert,
1957 convert_to_void, ): Use error_at and warning_at.
1958
1959 2012-05-10 Paolo Carlini <paolo.carlini@oracle.com>
1960
1961 PR c++/53301
1962 * decl.c (check_default_argument): Fix typo (POINTER_TYPE_P
1963 instead of TYPE_PTR_P) in zero-as-null-pointer-constant warning.
1964
1965 2012-05-06 Paolo Carlini <paolo.carlini@oracle.com>
1966
1967 PR c++/53152
1968 * call.c (op_error, build_new_op_1, build_new_op): Add location_t
1969 parameter.
1970 (build_conditional_expr_1): Adjust.
1971 * typeck.c (build_x_indirect_ref, build_x_binary_op,
1972 build_x_unary_op): Add location_t parameter.
1973 (rationalize_conditional_expr, build_x_array_ref,
1974 build_x_compound_expr, cp_build_modify_expr, build_x_modify_expr):
1975 Adjust.
1976 * typeck2.c (build_x_arrow): Add location_t parameter.
1977 * semantics.c (finish_unary_op_expr): Likewise.
1978 (finish_increment_expr, handle_omp_for_class_iterator): Adjust.
1979 * decl2.c (grok_array_decl): Add location_t parameter.
1980 * parser.c (cp_parser_postfix_open_square_expression,
1981 cp_parser_postfix_dot_deref_expression, cp_parser_unary_expression,
1982 cp_parser_binary_expression, cp_parser_builtin_offsetof,
1983 do_range_for_auto_deduction, cp_convert_range_for,
1984 cp_parser_template_argument, cp_parser_omp_for_cond): Pass the
1985 location, adjust.
1986 * pt.c (tsubst_copy_and_build): Adjust.
1987 * tree.c (maybe_dummy_object): Likewise.
1988 * cp-tree.h: Update declarations.
1989
1990 2012-05-04 Paolo Carlini <paolo.carlini@oracle.com>
1991
1992 * semantics.c (cxx_eval_constant_expression, case CONVERT_EXPR): Tidy.
1993
1994 2012-05-04 Paolo Carlini <paolo.carlini@oracle.com>
1995
1996 PR c++/53166
1997 * pt.c (instantiate_class_template_1): Increase / decrease
1998 c_inhibit_evaluation_warnings around the tsubst_expr call
1999 for STATIC_ASSERT_CONDITION.
2000 (tsubst_expr, case STATIC_ASSERT): Likewise.
2001 * typeck.c (cp_build_binary_op, case EQ_EXPR/NE_EXPR): Check
2002 c_inhibit_evaluation_warnings in the OPT_Waddress warnings.
2003
2004 2012-05-03 Paolo Carlini <paolo.carlini@oracle.com>
2005
2006 PR c++/53186
2007 * call.c (build_over_call): Handle final member functions
2008 and class types.
2009 (build_new_method_call_1): Do not handle here.
2010
2011 2012-05-02 Richard Guenther <rguenther@suse.de>
2012
2013 * decl.c (grokdeclarator): Properly check for sizes that
2014 cover more than half of the address-space.
2015
2016 2012-04-30 Marc Glisse <marc.glisse@inria.fr>
2017
2018 PR c++/51033
2019 * typeck.c (cp_build_array_ref): Handle VECTOR_TYPE.
2020 * decl2.c (grok_array_decl): Likewise.
2021
2022 PR c++/51314
2023 * parser.c (cp_parser_sizeof_operand): Require parentheses for
2024 sizeof...
2025
2026 2012-04-30 Dodji Seketeli <dodji@redhat.com>
2027
2028 Fix location for static class members
2029 * decl.c (grokdeclarator): Use the location carried by the
2030 declarator for the DECL of the static class member.
2031
2032 Fix va_arg type location
2033 * cp-tree.h (build_x_va_arg): Take an additional location
2034 parameter.
2035 * call.c (build_x_va_arg): Take a loc parameter for the location
2036 of the type of the va_arg expression.
2037 * parser.c (cp_parser_primary_expression): Pass the type of the
2038 type in the va_arg expression to build_x_va_arg.
2039 * pt.c (tsubst_copy): Adjust calls to build_x_va_arg.
2040
2041 Make conversion warnings work on NULL with -ftrack-macro-expansion
2042 * call.c (conversion_null_warnings): Use the new
2043 expansion_point_location_if_in_system_header.
2044 * cvt.c (build_expr_type_conversion): Likewise.
2045 * typeck.c (cp_build_binary_op): Likewise.
2046
2047 2012-04-30 Manuel López-Ibåñez <manu@gcc.gnu.org>
2048
2049 * typeck.c (convert_for_assignment): Replace
2050 Wmissing-format-attribute with Wsuggest-attribute=format.
2051 * call.c (convert_for_arg_passing): Likewise.
2052
2053 2012-04-26 Paolo Carlini <paolo.carlini@oracle.com>
2054
2055 PR c++/53096
2056 * class.c (check_bases_and_members): Implement core/1333, do not
2057 disallow defaulted in the class body non-const ref special members.
2058
2059 2012-04-24 Paolo Carlini <paolo.carlini@oracle.com>
2060
2061 PR c++/52363
2062 * call.c (tourney, perform_overload_resolution,
2063 build_operator_new_call, build_user_type_conversion_1,
2064 build_user_type_conversion, perform_overload_resolution,
2065 add_template_candidate, add_template_candidate_real,
2066 add_template_conv_candidate, add_builtin_candidates,
2067 add_builtin_candidate, build_builtin_candidate,
2068 add_conv_candidate, add_function_candidate, implicit_conversion,
2069 reference_binding, build_list_conv, conditional_conversion,
2070 add_candidates, can_convert_array, build_aggr_conv,
2071 build_array_conv, build_complex_conv, conditional_conversion):
2072 Add tsubst_flags_t parameter.
2073 (joust): Likewise, use it to handle SFINAE as if pedantic.
2074 (add_list_candidates, build_integral_nontype_arg_conv,
2075 perform_overload_resolution, build_new_function_call,
2076 build_operator_new_call, build_op_call_1,
2077 build_conditional_expr_1, build_new_op_1, convert_like_real,
2078 convert_arg_to_ellipsis, convert_default_arg,
2079 convert_for_arg_passing, build_over_call,
2080 build_new_method_call_1, can_convert_arg, can_convert_arg_bad,
2081 perform_implicit_conversion_flags,
2082 perform_direct_initialization_if_possible,
2083 initialize_reference): Adjust.
2084 * typeck.c (casts_away_constness, casts_away_constness_r):
2085 Add tsubst_flags_t parameter.
2086 (convert_arguments, check_for_casting_away_constness,
2087 build_static_cast_1, build_ptrmemfunc, convert_for_assignment):
2088 Adjust.
2089 * decl.c (reshape_init_r, check_default_argument): Likewise.
2090 * cp-gimplify.c (cxx_omp_clause_apply_fn): Likewise.
2091 * pt.c (convert_nontype_argument, check_non_deducible_conversion):
2092 Likewise.
2093 * init.c (build_new_1): Likewise.
2094 * cvt.c (convert_to_reference, ocp_convert, build_type_conversion,
2095 build_expr_type_conversion, ): Likewise.
2096 * search.c (check_final_overrider): Likewise.
2097 * cp-tree.h (build_user_type_conversion,
2098 build_operator_new_call, can_convert, can_convert_arg,
2099 can_convert_arg_bad, convert_default_arg,
2100 convert_arg_to_ellipsis, convert_for_arg_passing):
2101 Adjust declaration.
2102
2103 2012-04-22 Jan Hubicka <jh@suse.cz>
2104
2105 * decl2.c (maybe_make_one_only): Mark keyed COMDATs as USED so they
2106 gets finalized.
2107
2108 2012-04-22 Manuel López-Ibåñez <manu@gcc.gnu.org>
2109
2110 PR c/44774
2111 * typeck.c (composite_pointer_type): Likewise.
2112 (cxx_sizeof_or_alignof_type): Likewise.
2113 (cp_build_array_ref): Likewise.
2114 (cp_build_function_call_vec): Likewise.
2115 (cp_build_addr_expr_1): Likewise.
2116 (convert_member_func_to_ptr): Likewise.
2117 * decl.c (check_tag_decl): Likewise.
2118 (check_static_variable_definition): Likewise.
2119 (compute_array_index_type): Likewise.
2120 (create_array_type_for_decl): Likewise.
2121 (grokdeclarator): Likewise.
2122 (grok_op_properties): Likewise.
2123 * error.c (maybe_warn_cpp0x): Likewise.
2124 * pt.c (maybe_process_partial_specialization): Likewise.
2125 (convert_template_argument): Likewise.
2126 (do_decl_instantiation): Likewise.
2127 (do_type_instantiation): Likewise.
2128 * parser.c (cp_parser_primary_expression): Likewise.
2129 (cp_parser_postfix_expression): Likewise.
2130 (cp_parser_unary_expression): Likewise.
2131 (cp_parser_question_colon_clause): Likewise.
2132 (cp_parser_lambda_introducer): Likewise.
2133 (cp_parser_lambda_declarator_opt): Likewise.
2134 (cp_parser_compound_statement): Likewise.
2135 (cp_parser_jump_statement): Likewise.
2136 (cp_parser_declaration_seq_opt): Likewise.
2137 (cp_parser_enum_specifier): Likewise.
2138 (cp_parser_enumerator_list): Likewise.
2139 (cp_parser_initializer_list): Likewise.
2140 (cp_parser_member_declaration): Likewise.
2141 * call.c (build_conditional_expr_1): Likewise.
2142 * friend.c (make_friend_class): Likewise.
2143 * name-lookup.c (pushdecl_maybe_friend_1): Likewise.
2144
2145 2012-04-21 Jan Hubicka <jh@suse.cz>
2146
2147 * method.c (make_alias_for): Do not set TREE_SYMBOL_REFERENCED.
2148 * decl2.c (mark_needed): Likewise.
2149 (decl_needed_p): Do not test TREE_SYMBOL_REFERENCED.
2150
2151 * decl2.c (cxx_callgraph_analyze_expr): Remove.
2152 * cp-objcp-common.h (LANG_HOOKS_CALLGRAPH_ANALYZE_EXPR): Remove.
2153 * cp-tree.h (cxx_callgraph_analyze_expr): Remove.
2154
2155 2012-04-21 Manuel López-Ibåñez <manu@gcc.gnu.org>
2156
2157 PR 35441
2158 * typeck.c (cp_build_function_call_vec): Do not pretty-print
2159 expressions when caret is enabled.
2160
2161 2012-04-20 Jan Hubicka <jh@suse.cz>
2162
2163 PR target/53042
2164 * decl2.c (maybe_emit_vtables): Do not initialize same_comdat_group
2165 list when target has no support for it.
2166
2167 2012-04-20 Michael Matz <matz@suse.de>
2168
2169 * error.c (pedwarn_cxx98): Move va_end call after user
2170 of the va_list.
2171
2172 2012-04-18 Paolo Carlini <paolo.carlini@oracle.com>
2173
2174 PR c++/52422
2175 * cp-tree.h (build_addr_func, decay_conversion,
2176 get_member_function_from_ptrfunc,
2177 build_m_component_ref, convert_member_func_to_ptr):
2178 Add tsubst_flags_t parameter.
2179 * typeck.c (cp_default_conversion): Add.
2180 (decay_conversion, default_conversion,
2181 get_member_function_from_ptrfunc, convert_member_func_to_ptr):
2182 Add tsubst_flags_t parameter and use it throughout.
2183 (cp_build_indirect_ref, cp_build_array_ref,
2184 cp_build_function_call_vec, convert_arguments, build_x_binary_op,
2185 cp_build_binary_op, cp_build_unary_op, build_reinterpret_cast_1,
2186 build_const_cast_1, expand_ptrmemfunc_cst,
2187 convert_for_initialization): Adjust.
2188 * init.c (build_vec_init): Adjust.
2189 * decl.c (grok_reference_init, get_atexit_node): Likewise.
2190 * rtti.c (build_dynamic_cast_1, tinfo_base_init): Likewise.
2191 * except.c (build_throw): Likewise.
2192 * typeck2.c (build_x_arrow): Likewise.
2193 (build_m_component_ref): Add tsubst_flags_t parameter and
2194 use it throughout.
2195 * pt.c (convert_nontype_argument): Adjust.
2196 * semantics.c (finish_asm_stmt, maybe_add_lambda_conv_op): Likewise.
2197 * decl2.c (build_offset_ref_call_from_tree): Likewise.
2198 * call.c (build_addr_func): Add tsubst_flags_t parameter and
2199 use it throughout.
2200 (build_call_a, build_conditional_expr_1, build_new_op_1,
2201 convert_like_real, convert_arg_to_ellipsis, build_over_call,
2202 build_special_member_call): Adjust.
2203 * cvt.c (cp_convert_to_pointer, force_rvalue,
2204 build_expr_type_conversion): Likewise.
2205
2206 2012-04-17 Tom de Vries <tom@codesourcery.com>
2207
2208 * cp-gimplify.c (begin_bc_block): Add location parameter and use as
2209 location argument to create_artificial_label.
2210 (finish_bc_block): Change return type to void. Remove body_seq
2211 parameter, and add block parameter. Append label to STMT_LIST and
2212 return in block.
2213 (gimplify_cp_loop, gimplify_for_stmt, gimplify_while_stmt)
2214 (gimplify_do_stmt, gimplify_switch_stmt): Remove function.
2215 (genericize_cp_loop, genericize_for_stmt, genericize_while_stmt)
2216 (genericize_do_stmt, genericize_switch_stmt, genericize_continue_stmt)
2217 (genericize_break_stmt, genericize_omp_for_stmt): New function.
2218 (cp_gimplify_omp_for): Remove bc_continue processing.
2219 (cp_gimplify_expr): Genericize VEC_INIT_EXPR.
2220 (cp_gimplify_expr): Mark FOR_STMT, WHILE_STMT, DO_STMT, SWITCH_STMT,
2221 CONTINUE_STMT, and BREAK_STMT as unreachable.
2222 (cp_genericize_r): Genericize FOR_STMT, WHILE_STMT, DO_STMT,
2223 SWITCH_STMT, CONTINUE_STMT, BREAK_STMT and OMP_FOR.
2224 (cp_genericize_tree): New function, factored out of ...
2225 (cp_genericize): ... this function.
2226
2227 2012-04-17 Paolo Carlini <paolo.carlini@oracle.com>
2228
2229 PR c++/52599
2230 * semantics.c (build_constexpr_constructor_member_initializers):
2231 Check for function-try-block as function-body.
2232
2233 2012-04-17 Paolo Carlini <paolo.carlini@oracle.com>
2234
2235 PR c++/53003
2236 * parser.c (cp_parser_member_declaration): Check that
2237 initializer_token_start is non null before dereferencing it.
2238
2239 2012-04-16 Jason Merrill <jason@redhat.com>
2240
2241 PR c++/38543
2242 * pt.c (determine_specialization): Instead of comparing the number
2243 of parms, check that tsubst gives the right answer.
2244
2245 PR c++/52008
2246 * pt.c (process_partial_specialization): Complain about a partial
2247 specialization with fewer args than primary template parms.
2248
2249 PR c++/50830
2250 * pt.c (convert_template_argument): Handle template template
2251 argument packs.
2252
2253 PR c++/50303
2254 * pt.c (tsubst_pack_expansion): Use tsubst_expr for template
2255 template parameters.
2256
2257 2012-04-16 Paolo Carlini <paolo.carlini@oracle.com>
2258
2259 PR c++/49152
2260 * call.c (op_error): Print types; when flag_diagnostics_show_caret
2261 is false print expressions too.
2262 (op_error_string): Add.
2263
2264 2012-04-16 Jason Merrill <jason@redhat.com>
2265
2266 PR c++/51148
2267 * friend.c (make_friend_class): Call check_for_bare_parameter_packs.
2268
2269 2012-04-16 Jan Hubicka <jh@suse.cz>
2270
2271 * decl2.c (collect_candidates_for_java_method_alias): Use FOR_EACH
2272 walkers to walk cgraph and varpool.
2273
2274 2012-04-15 Jason Merrill <jason@redhat.com>
2275
2276 PR c++/47220
2277 * pt.c (coerce_template_parameter_pack): Check for error_mark_node.
2278
2279 PR c++/52292
2280 PR c++/52380
2281 * pt.c (coerce_template_parms): Even if we aren't converting we
2282 want to expand argument packs.
2283
2284 PR c++/52706
2285 * mangle.c (write_type): nullptr_t is a builtin type.
2286
2287 2012-04-14 Jan Hubicka <jh@suse.cz>
2288
2289 * tree.c: Update field referenced for new cgraph/varpool layout.
2290 * decl2.c: Likewise.
2291
2292 2012-04-13 Jason Merrill <jason@redhat.com>
2293
2294 PR c++/52824
2295 * pt.c (any_pack_expanson_args_p): New.
2296 (coerce_template_parms): Use it.
2297
2298 PR c++/52905
2299 * call.c (joust): Handle comparing list and non-list ctors.
2300
2301 PR c++/52915
2302 * decl2.c (finish_anon_union): Use cp_finish_decl.
2303 * error.c (dump_function_name): Avoid showing anonymous "name".
2304
2305 2012-04-11 Fabien ChĂȘne <fabien@gcc.gnu.org>
2306
2307 PR c++/52465
2308 * parser.c (cp_parser_class_name): Call strip_using_decl and
2309 return the target decl.
2310 * name-lookup.c (strip_using_decl): Returns NULL_TREE if the decl
2311 to be stripped is NULL_TREE.
2312 (qualify_lookup): Call strip_using_decl and perform some checks on
2313 the target decl.
2314
2315 2012-04-11 Jason Merrill <jason@redhat.com>
2316
2317 PR debug/45088
2318 * decl.c (grokdeclarator): Strip the injected-class-name typedef
2319 if we are building a declaration or compound type.
2320
2321 PR c++/52906
2322 * decl.c (check_tag_decl): Don't complain about attributes if we
2323 don't even have a type.
2324
2325 2012-04-10 Manuel López-Ibåñez <manu@gcc.gnu.org>
2326
2327 * cvt.c (convert_to_void): Update comment.
2328
2329 2012-04-05 Jason Merrill <jason@redhat.com>
2330
2331 PR c++/52596
2332 * semantics.c (finish_non_static_data_member): In templates, pass
2333 the decl to build_qualified_name.
2334 * tree.c (lvalue_kind) [SCOPE_REF]: Handle FIELD_DECL.
2335
2336 2012-04-04 Jason Merrill <jason@redhat.com>
2337
2338 PR c++/52845
2339 * decl.c (finish_function): Update fntype after deducing return type.
2340
2341 2012-04-03 Jason Merrill <jason@redhat.com>
2342
2343 PR c++/52796
2344 * pt.c (tsubst_initializer_list): A pack expansion with no elements
2345 means value-initialization.
2346
2347 2012-04-01 Paolo Carlini <paolo.carlini@oracle.com>
2348
2349 PR c++/50043
2350 * class.c (deduce_noexcept_on_destructor,
2351 deduce_noexcept_on_destructors): New.
2352 (check_bases_and_members): Call the latter.
2353 * decl.c (grokfndecl): Call the former.
2354 * method.c (implicitly_declare_fn): Not static.
2355 * cp-tree.h (deduce_noexcept_on_destructor, implicitly_declare_fn):
2356 Declare
2357
2358 2012-03-29 Paolo Carlini <paolo.carlini@oracle.com>
2359
2360 PR c++/52718
2361 * decl.c (check_default_argument): With -Wzero-as-null-pointer-constant
2362 warn for a zero as null pointer constant default argument.
2363
2364 2012-03-29 Jason Merrill <jason@redhat.com>
2365
2366 PR c++/52685
2367 * tree.c (copy_binfo): Handle BINFO_DEPENDENT_BASE_P.
2368
2369 2012-03-29 Jakub Jelinek <jakub@redhat.com>
2370
2371 PR c++/52759
2372 * decl.c (start_decl): Don't call maybe_apply_pragma_weak
2373 if processing_template_decl.
2374
2375 2012-03-29 Jason Merrill <jason@redhat.com>
2376
2377 PR c++/52743
2378 * call.c (compare_ics): Handle ck_aggr like ck_list.
2379
2380 2012-03-28 Jason Merrill <jason@redhat.com>
2381
2382 PR c++/52746
2383 * typeck.c (lookup_destructor): Clear BASELINK_QUALIFIED_P if
2384 we didn't get an explicit scope.
2385 * pt.c (tsubst_baselink): Likewise.
2386
2387 2012-03-28 Richard Guenther <rguenther@suse.de>
2388
2389 * typeck2.c (process_init_constructor_array): Use the proper
2390 type for computing the array length.
2391
2392 2012-03-27 Meador Inge <meadori@codesourcery.com>
2393
2394 PR c++/52672
2395 * semantics.c (cxx_fold_indirect_ref): Don't attempt to fold
2396 stripped child trees that are not pointer types.
2397
2398 2012-03-21 Jason Merrill <jason@redhat.com>
2399
2400 Implement return type deduction for normal functions with -std=c++1y.
2401 * cp-tree.h (FNDECL_USED_AUTO): New macro.
2402 (LAMBDA_EXPR_DEDUCE_RETURN_TYPE_P): Remove.
2403 (dependent_lambda_return_type_node): Remove.
2404 (CPTI_DEPENDENT_LAMBDA_RETURN_TYPE): Remove.
2405 (struct language_function): Add x_auto_return_pattern field.
2406 (current_function_auto_return_pattern): New.
2407 (enum tsubst_flags): Add tf_partial.
2408 * decl.c (decls_match): Handle auto return comparison.
2409 (duplicate_decls): Adjust error message for auto return.
2410 (cxx_init_decl_processing): Remove dependent_lambda_return_type_node.
2411 (cp_finish_decl): Don't do auto deduction for functions.
2412 (grokdeclarator): Allow auto return without trailing return type in
2413 C++1y mode.
2414 (check_function_type): Defer checking of deduced return type.
2415 (start_preparsed_function): Set current_function_auto_return_pattern.
2416 (finish_function): Set deduced return type to void if not previously
2417 deduced.
2418 * decl2.c (change_return_type): Handle error_mark_node.
2419 (mark_used): Always instantiate functions with deduced return type.
2420 Complain about use if deduction isn't done.
2421 * parser.c (cp_parser_lambda_declarator_opt): Use 'auto' for
2422 initial return type.
2423 (cp_parser_lambda_body): Don't deduce return type in a template.
2424 (cp_parser_conversion_type_id): Allow auto in C++1y.
2425 * pt.c (instantiate_class_template_1): Don't mess with
2426 LAMBDA_EXPR_DEDUCE_RETURN_TYPE_P.
2427 (tsubst_copy_and_build): Likewise.
2428 (fn_type_unification, tsubst): Don't reduce the template parm level
2429 of 'auto' during deduction.
2430 (unify): Compare 'auto' specially.
2431 (get_bindings): Change test.
2432 (always_instantiate_p): Always instantiate functions with deduced
2433 return type.
2434 (do_auto_deduction): Handle error_mark_node and lambda context.
2435 Don't check for use in initializer.
2436 (contains_auto_r): Remove.
2437 * search.c (lookup_conversions_r): Handle auto conversion function.
2438 * semantics.c (lambda_return_type): Handle null return. Don't mess
2439 with dependent_lambda_return_type_node.
2440 (apply_deduced_return_type): Rename from apply_lambda_return_type.
2441 * typeck.c (merge_types): Handle auto.
2442 (check_return_expr): Do auto deduction.
2443 * typeck2.c (add_exception_specifier): Fix complain check.
2444
2445 2012-03-22 Paolo Carlini <paolo.carlini@oracle.com>
2446
2447 PR c++/52487
2448 * class.c (check_field_decls): Call literal_type_p only
2449 on complete types.
2450
2451 2012-03-22 Jakub Jelinek <jakub@redhat.com>
2452
2453 PR c++/52671
2454 * decl.c (check_tag_decl): Only use CLASSTYPE_TEMPLATE_INSTANTIATION
2455 on CLASS_TYPE_P types.
2456
2457 2012-03-20 Jason Merrill <jason@redhat.com>
2458
2459 * lex.c (init_reswords): Use >= for cxx_dialect test.
2460 * parser.c (cp_parser_exception_specification_opt): Likewise.
2461
2462 * mangle.c (write_type): Handle 'auto'.
2463 * init.c (build_new): Don't do auto deduction where it might
2464 affect template mangling.
2465
2466 PR c++/52510
2467 * decl.c (reshape_init_class): Handle repeated reshaping.
2468 * search.c (lookup_field_1): Add sanity check.
2469
2470 2012-03-19 Paolo Carlini <paolo.carlini@oracle.com>
2471
2472 PR c++/14710
2473 * cp-tree.h (xvalue_p, maybe_warn_about_useless_cast): Declare.
2474 * tree.c (xvalue_p): Define.
2475 * typeck.c (maybe_warn_about_useless_cast): Define.
2476 (build_reinterpret_cast, build_const_cast,
2477 build_static_cast, cp_build_c_cast): Use maybe_warn_about_useless_cast.
2478 * rtti.c (build_dynamic_cast): Likewise.
2479 * pt.c (tsubst_copy_and_build, case CAST_EXPR): Increment/decrement
2480 c_inhibit_evaluation_warnings before/after the build_* calls.
2481
2482 2012-03-15 Jason Merrill <jason@redhat.com>
2483
2484 PR c++/52582
2485 * method.c (implicitly_declare_fn): Set DECL_EXTERNAL.
2486
2487 2012-03-15 Manuel López-Ibåñez <manu@gcc.gnu.org>
2488
2489 PR c++/44783
2490 * error.c (print_instantiation_partial_context): Use
2491 template_backtrace_limit.
2492
2493 2012-03-14 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
2494
2495 * Make-lang.in (doc/g++.1): Remove IRIX 6.5 reference.
2496
2497 2012-03-14 Jakub Jelinek <jakub@redhat.com>
2498
2499 PR c++/52521
2500 * parser.c (lookup_literal_operator): Return fn only if
2501 processed all arguments from args vector and argtypes is
2502 void_list_node.
2503
2504 2012-01-30 Dodji Seketeli <dodji@redhat.com>
2505
2506 PR c++/51641
2507 * cp-tree.h (template_type_parameter_p): Declare new function.
2508 (parameter_of_template_p): Remove.
2509 * pt.c (template_type_parameter_p): Define new function.
2510 (parameter_of_template_p): Remove.
2511 * name-lookup.c (binding_to_template_parms_of_scope_p): Don't rely
2512 on parameter_of_template_p anymore. Compare the level of the
2513 template parameter to the depth of the template.
2514
2515 2011-12-15 Dodji Seketeli <dodji@redhat.com>
2516
2517 * call.c (standard_conversion, build_integral_nontype_arg_conv)
2518 (build_new_op_1, convert_like_real, is_subseq)
2519 (maybe_handle_implicit_object, maybe_handle_ref_bind, compare_ics)
2520 (joust): Use next_conversion instead of accessing fields of struct
2521 conversion directly.
2522
2523 2012-03-12 Paolo Carlini <paolo.carlini@oracle.com>
2524
2525 PR c++/52299
2526 * pt.c (tsubst_copy_and_build, case COND_EXPR): Avoid bogus
2527 division by zero warnings.
2528
2529 2012-03-08 Paolo Carlini <paolo.carlini@oracle.com>
2530
2531 * typeck.c (build_array_ref, cp_build_addr_expr_1, convert_ptrmem,
2532 build_ptrmemfunc): Consistently forward the tsubst_flags_t
2533 parameter.
2534 * call.c (resolve_args): Likewise.
2535
2536 2012-03-07 Jason Merrill <jason@redhat.com>
2537
2538 PR c++/52521
2539 * mangle.c (write_literal_operator_name): The length comes after the
2540 operator prefix.
2541
2542 2012-03-05 Jakub Jelinek <jakub@redhat.com>
2543
2544 * pt.c (local_specializations): Change from htab_t into
2545 struct pointer_map_t *.
2546 (retrieve_local_specializations, register_local_specialization,
2547 tsubst_pack_expansion, instantiate_decl): Adjust users.
2548 (eq_local_specializations, hash_local_specialization): Remove.
2549
2550 2012-03-05 Jason Merrill <jason@redhat.com>
2551
2552 PR c++/51930
2553 * decl2.c (determine_visibility): Correct calculation of class
2554 args depth.
2555 * decl.c (check_tag_decl): Adjust warning.
2556
2557 * method.c (synthesized_method_walk): Cleanups don't affect the EH
2558 spec either.
2559
2560 2012-03-03 Jason Merrill <jason@redhat.com>
2561
2562 * init.c (perform_member_init): Cope with uninstantiated NSDMI.
2563
2564 Core 1270
2565 * call.c (build_aggr_conv): Call reshape_init.
2566 (convert_like_real): Likewise.
2567 * typeck2.c (process_init_constructor): Clear TREE_CONSTANT if
2568 not all constant.
2569
2570 * mangle.c (write_nested_name): Use decl_mangling_context.
2571 (write_prefix, write_template_prefix): Likewise.
2572
2573 PR c++/36797
2574 * mangle.c (write_expression): Improve diagnostic for TRAIT_EXPR.
2575
2576 * class.c (add_method): Always build an OVERLOAD for using-decls.
2577 * search.c (lookup_member): Handle getting an OVERLOAD for a
2578 single function.
2579
2580 2012-03-02 Paolo Carlini <paolo.carlini@oracle.com>
2581
2582 PR c++/51989
2583 * typeck2.c (build_x_arrow): Take a tsubst_flags_t argument and
2584 propagate it.
2585 * cp-tree.h (build_x_arrow): Adjust prototype.
2586 * pt.c (tsubst_copy_and_build): Adjust call.
2587 * parser.c (cp_parser_postfix_dot_deref_expression): Likewise.
2588
2589 2012-03-02 Paolo Carlini <paolo.carlini@oracle.com>
2590
2591 * name-lookup.c (binding_to_template_parms_of_scope_p): Clean up.
2592
2593 2012-02-29 Jason Merrill <jason@redhat.com>
2594
2595 PR c++/51930
2596 * decl.c (check_tag_decl): Move warning for misplaced attributes here.
2597 (shadow_tag): From here.
2598 * parser.c (cp_parser_explicit_instantiation): Don't warn here.
2599
2600 2012-02-21 Jakub Jelinek <jakub@redhat.com>
2601
2602 PR c++/52312
2603 * typeck.c (check_literal_operator_args): Initialize *long_double_p
2604 and *long_long_unsigned_p even if processing_template_decl.
2605
2606 2012-02-16 Jason Merrill <jason@redhat.com>
2607
2608 PR c++/52248
2609 * decl.c (define_label): Use timevar_cond_start/stop.
2610
2611 2012-02-16 Fabien ChĂȘne <fabien@gcc.gnu.org>
2612
2613 PR c++/52126
2614 * decl.c (xref_basetypes): call dependent_scope_p instead of
2615 dependent_type_p.
2616
2617 2012-02-16 Jason Merrill <jason@redhat.com>
2618
2619 PR c++/51415
2620 * error.c (dump_expr): Handle lambda closures specifically.
2621
2622 2012-02-14 Jason Merrill <jason@redhat.com>
2623
2624 * parser.c (cp_parser_explicit_instantiation): Give a warning
2625 for ignored attributes on explicit class instantiation.
2626
2627 2012-02-14 Jakub Jelinek <jakub@redhat.com>
2628
2629 PR c++/52247
2630 * pt.c (tsubst_copy_asm_operands): For LABEL_DECL values call
2631 lookup_label on label's name and set TREE_USED.
2632
2633 2012-02-14 Jason Merrill <jason@redhat.com>
2634
2635 PR c++/39055
2636 * decl.c (local_variable_p_walkfn): Don't check DECL_ARTIFICIAL.
2637
2638 2012-02-14 Jakub Jelinek <jakub@redhat.com>
2639
2640 PR c/52181
2641 * decl.c (duplicate_decls): If olddecl has bigger DECL_ALIGN than
2642 newdecl, copy DECL_ALIGN to newdecl and or DECL_USER_ALIGN bits.
2643
2644 2012-02-07 Jason Merrill <jason@redhat.com>
2645
2646 PR c++/51675
2647 * semantics.c (cx_check_missing_mem_inits): Handle unions.
2648 Fix constexpr default constructor logic.
2649
2650 PR c++/52035
2651 * pt.c (tsubst): Strip uninstantiated typedef.
2652
2653 2012-02-06 Jason Merrill <jason@redhat.com>
2654
2655 PR c++/52088
2656 * cvt.c (build_expr_type_conversion): Check for template conversion.
2657
2658 2012-01-31 Jason Merrill <jason@redhat.com>
2659
2660 PR c++/52043
2661 * cp-tree.h (PACK_EXPANSION_LOCAL_P): New.
2662 * pt.c (make_pack_expansion, tsubst_initializer_list): Set it.
2663 (tsubst_pack_expansion): Check it.
2664
2665 2012-01-29 Paolo Carlini <paolo.carlini@oracle.com>
2666
2667 PR c++/51327
2668 * class.c (explain_non_literal_class): Correctly handle implicitly
2669 deleted constructors.
2670
2671 2012-01-27 Jakub Jelinek <jakub@redhat.com>
2672
2673 PR c++/51852
2674 * pt.c (tsubst_pack_expansion): Delete and restore
2675 local_specialization whenever need_local_specialization, not just
2676 when saved_local_specializations is non-NULL.
2677
2678 2012-01-26 Paolo Carlini <paolo.carlini@oracle.com>
2679
2680 PR c++/51370
2681 * error.c (dump_decl, [TEMPLATE_ID_EXPR]): Handle error_mark_node
2682 as TREE_OPERAND (t, 1).
2683
2684 2012-01-24 Jason Merrill <jason@redhat.com>
2685
2686 PR c++/51917
2687 * decl.c (xref_basetypes): Check VEC_length instead of VEC_space.
2688
2689 PR c++/51973
2690 * tree.c (called_fns_equal): Check template args.
2691 (cp_tree_equal): Call it.
2692
2693 2012-01-24 Aldy Hernandez <aldyh@redhat.com>
2694 Patrick Marlier <patrick.marlier@gmail.com>
2695
2696 PR c++/51928
2697 * class.c (set_method_tm_attributes): Use TARGET_THUNK instead of
2698 thunk for set_one_vmethod_tm_attributes.
2699
2700 2012-01-24 Paolo Carlini <paolo.carlini@oracle.com>
2701
2702 PR c++/51223
2703 * call.c (build_over_call): Check for error_mark_node as
2704 TREE_VALUE when default arguments are processed.
2705
2706 2012-01-23 Jason Merrill <jason@redhat.com>
2707
2708 PR c++/51930
2709 * decl2.c (determine_visibility): Check for visibility attribute
2710 on template specialization.
2711
2712 2012-01-23 Paolo Carlini <paolo.carlini@oracle.com>
2713
2714 PR c++/51398
2715 * pt.c (parameter_of_template_p): Skip error_mark_node parameters.
2716
2717 2012-01-23 Jason Merrill <jason@redhat.com>
2718
2719 PR c++/51925
2720 * class.c (add_method): Set OVL_USED for using-decls.
2721 * tree.c (ovl_scope): New.
2722 * cp-tree.h: Declare it.
2723 * parser.c (cp_parser_template_name): Use it.
2724 * semantics.c (baselink_for_fns): Likewise.
2725 * name-lookup.c (set_inherited_value_binding_p): Likewise.
2726
2727 2012-01-20 Paolo Carlini <paolo.carlini@oracle.com>
2728
2729 PR c++/51402
2730 * pt.c (lookup_template_class_1): Check context returned by
2731 tsubst for error_mark_node.
2732
2733 2012-01-19 Kai Tietz <ktietz@redhat.com>
2734
2735 PR c++/51344
2736 * decl2.c (save_template_attributes): Use merge_attributes
2737 instead of chaining up via TREE_CHAIN.
2738
2739 2012-01-19 Jason Merrill <jason@redhat.com>
2740
2741 PR c++/51889
2742 * class.c (finish_struct): Call add_method here for function usings.
2743 * semantics.c (finish_member_declaration): Not here.
2744
2745 2012-01-18 Paolo Carlini <paolo.carlini@oracle.com>
2746
2747 PR c++/51225
2748 * typeck2.c (store_init_value): Within a template guard
2749 cxx_constant_value with require_potential_constant_expression.
2750 * pt.c (convert_nontype_argument): Likewise.
2751
2752 2012-01-16 Jakub Jelinek <jakub@redhat.com>
2753
2754 PR c++/51854
2755 * mangle.c (write_template_arg_literal): Handle complex.
2756
2757 2012-01-16 Jason Merrill <jason@redhat.com>
2758
2759 PR c++/51827
2760 * mangle.c (mangle_decl): Don't mangle uninstantiated templates.
2761
2762 PR c++/51868
2763 * typeck.c (build_static_cast_1): Handle bit-fields properly.
2764
2765 2012-01-13 Ian Lance Taylor <iant@google.com>
2766
2767 PR c++/50012
2768 * typeck.c (enum_cast_to_int): New static function.
2769 (cp_build_binary_op): When handling warn_sign_compare, don't test
2770 for TREE_NO_WARNING. Do call enum_cast_to_int.
2771 * call.c (avoid_sign_compare_warnings): Remove static function.
2772 (build_new_op_1): Don't call avoid_sign_compare_warnings.
2773
2774 2012-01-13 Steven Bosscher <steven@gcc.gnu.org>
2775
2776 * decl2.c: Do not include tree-mudflap.h
2777 * semantics.c: Likewise.
2778
2779 2012-01-13 Jason Merrill <jason@redhat.com>
2780
2781 PR c++/20681
2782 * semantics.c (finish_break_stmt): Avoid adding an unreachable
2783 BREAK_STMT.
2784
2785 PR c++/51813
2786 * decl2.c (constrain_visibility): Clear DECL_VISIBILITY_SPECIFIED
2787 when reducing the visibility.
2788
2789 PR c++/51620
2790 * class.c (build_vtbl_initializer): Use __cxa_deleted_virtual.
2791
2792 2012-01-12 Jason Merrill <jason@redhat.com>
2793
2794 PR c++/51714
2795 * pt.c (value_dependent_expression_p): Treat STMT_EXPR as
2796 value-dependent.
2797
2798 2012-01-13 Dodji Seketeli <dodji@redhat.com>
2799
2800 PR c++/51633
2801 * semantics.c (cp_parser_ctor_initializer_opt_and_function_body):
2802 Set the pointer to the last block of the constructor to the
2803 current statement.
2804 (build_constexpr_constructor_member_initializers): Get
2805 build_data_member_initialization a chance to deal with more
2806 statements before we choke.
2807
2808 2012-01-12 Jason Merrill <jason@redhat.com>
2809
2810 PR c++/48051
2811 * mangle.c (write_expression): Mangle BASELINK scope if
2812 BASELINK_QUALIFIED_P.
2813 * search.c (adjust_result_of_qualified_name_lookup): Set
2814 BASELINK_QUALIFIED_P.
2815 * tree.c (cp_tree_equal) [BASELINK]: Compare BASELINK_QUALIFIED_P.
2816 * parser.c (cp_parser_postfix_dot_deref_expression): Don't call
2817 adjust_result_of_qualified_name_lookup for non-qualified names.
2818
2819 PR c++/51403
2820 * pt.c (unify): Handle error_mark_node.
2821
2822 2012-01-11 Jason Merrill <jason@redhat.com>
2823
2824 PR c++/51565
2825 * call.c (standard_conversion): For ptrmemfuncs, compare the
2826 static_fn_types.
2827
2828 PR c++/51818
2829 * mangle.c (find_substitution): A type is only a substitution
2830 match if we're looking for a type.
2831 (write_nested_name): Use decl_mangling_context.
2832
2833 * decl.c (decls_match): Assert that the arguments are decls.
2834
2835 PR c++/51613
2836 * pt.c (resolve_overloaded_unification): Compare types with
2837 same_type_p, not decls_match.
2838
2839 2012-01-10 Jason Merrill <jason@redhat.com>
2840
2841 PR c++/51614
2842 * class.c (build_base_path): Diagnose ambiguous base.
2843
2844 PR c++/51433
2845 * semantics.c (cxx_eval_call_expression): Always retry previously
2846 non-constant expressions.
2847
2848 2012-01-06 Jason Merrill <jason@redhat.com>
2849
2850 DR 686
2851 PR c++/47450
2852 * parser.c (cp_parser_new_expression): Set
2853 type_definition_forbidden_message.
2854
2855 PR c++/6057
2856 PR c++/48051
2857 PR c++/50855
2858 PR c++/51322
2859 * mangle.c (write_expression): Support NEW_EXPR, DELETE_EXPR,
2860 THROW_EXPR, CONSTRUCTOR, OVERLOAD. Fix PREINCREMENT_EXPR and
2861 PREDECREMENT_EXPR.
2862 (write_template_arg): Fix mangling of class-scope functions and
2863 argument packs.
2864 (mangle_decl): Update suggested -fabi-version argument.
2865 * operators.def: Add DOTSTAR_EXPR, REINTERPRET_CAST_EXPR,
2866 DYNAMIC_CAST_EXPR; correct CONST_CAST_EXPR, STATIC_CAST_EXPR.
2867 * tree.c (dependent_name): No longer static.
2868 * cp-tree.h: Declare it.
2869 * pt.c (unify): Defer handling of unconverted functions.
2870
2871 * mangle.c (mangle_decl): Don't generate mangling aliases
2872 for maybe-in-charge [cd]tors.
2873
2874 * error.c (dump_expr): Print type of CONSTRUCTOR.
2875
2876 2012-01-05 Dodji Seketeli <dodji@redhat.com>
2877
2878 PR c++/51541
2879 * parser.c (cp_parser_alias_declaration): Get out early upon
2880 errors in the identifier or the attributes.
2881
2882 2012-01-04 Paolo Carlini <paolo.carlini@oracle.com>
2883
2884 PR c++/51064
2885 * pt.c (tsubst_copy_and_build): Maybe set TREE_NO_WARNING on
2886 the tree returned by build_x_binary_op.
2887
2888 2012-01-03 Paolo Carlini <paolo.carlini@oracle.com>
2889
2890 PR c++/51738
2891 * parser.c (cp_parser_postfix_open_square_expression): Handle
2892 postfix-expression [ braced-init-list ].
2893
2894 2012-01-03 Paolo Carlini <paolo.carlini@oracle.com>
2895
2896 PR c++/29273
2897 * rtti.c (build_dynamic_cast_1): In case of T a pointer type,
2898 call decay_conversion on v.
2899
2900 2012-01-03 Paolo Carlini <paolo.carlini@oracle.com>
2901
2902 PR c++/15867
2903 * decl.c (duplicate_decls): With -Wredundant-decls don't warn for
2904 declaration followed by specialization.
2905
2906 2012-01-03 Jakub Jelinek <jakub@redhat.com>
2907
2908 PR c++/51669
2909 * semantics.c (finish_omp_clauses): Call fold_build_cleanup_point_expr
2910 on OMP_CLAUSE_{IF,FINAL,NUM_THREADS,SCHEDULE_CHUNK}_EXPR.
2911
2912 2012-01-02 Jason Merrill <jason@redhat.com>
2913
2914 DR 1359
2915 PR c++/51675
2916 * method.c (walk_field_subobs): Don't check for uninitialized
2917 fields in a union.
2918 (synthesized_method_walk): Check here.
2919
2920 DR 325
2921 PR c++/51666
2922 * parser.c (cp_parser_cache_defarg): Split out...
2923 (cp_parser_parameter_declaration): ...from here.
2924 (cp_parser_save_nsdmi): Use it.
2925 (cp_parser_cache_group): Remove CPP_COMMA support.
2926
2927 2012-01-02 Dodji Seketeli <dodji@redhat.com>
2928
2929 PR c++/51462
2930 * semantics.c (cx_check_missing_mem_inits): Don't assert in case
2931 of error.
2932
2933 2012-01-02 Paolo Carlini <paolo.carlini@oracle.com>
2934
2935 PR c++/20140
2936 * typeck2.c (digest_init_r): Use copy_init when initializing
2937 an array of chars.
2938
2939 2012-01-01 Paolo Carlini <paolo.carlini@oracle.com>
2940
2941 PR c++/16603
2942 * decl.c (build_enumerator): Don't call perform_integral_promotions
2943 on the value.
2944
2945 2012-01-01 Paolo Carlini <paolo.carlini@oracle.com>
2946
2947 PR c++/51379
2948 * typeck.c (build_reinterpret_cast_1): Implement resolution of
2949 DR 799.
2950
2951 2012-01-01 Fabien ChĂȘne <fabien@gcc.gnu.org>
2952
2953 * parser.c (cp_parser_using_declaration): Add a warning about
2954 deprecated access declarations when no errors were encountered
2955 while parsing the access declaration. Save the first token in
2956 order to emit the warning at the right place.
2957 \f
2958 Copyright (C) 2012 Free Software Foundation, Inc.
2959
2960 Copying and distribution of this file, with or without modification,
2961 are permitted in any medium without royalty provided the copyright
2962 notice and this notice are preserved.