]> git.ipfire.org Git - thirdparty/gcc.git/blob - gcc/cp/ChangeLog
fc43db0b94c0ec2995cf8c0821395e4b954395d3
[thirdparty/gcc.git] / gcc / cp / ChangeLog
1 2013-09-25 Tom Tromey <tromey@redhat.com>
2
3 * Make-lang.in (g++spec.o): Don't use subshell.
4
5 2013-09-25 Marek Polacek <polacek@redhat.com>
6
7 PR c++/58516
8 * semantics.c (finish_transaction_stmt): Check for EXPR_P before
9 setting the expr location.
10
11 2013-09-23 Adam Butcher <adam@jessamine.co.uk>
12
13 PR c++/58500
14 * type-utils.h (find_type_usage): Only traverse one type level into
15 member function pointers.
16
17 2013-09-23 Adam Butcher <adam@jessamine.co.uk>
18
19 * parser.c (cp_parser_init_declarator): Defer calling
20 finish_fully_implicit_template for forward declarations until after
21 other decl processing is complete. Cleanup for clarity: Extract 'else'
22 case after 'if' containing unconditional return.
23
24 2013-09-23 Adam Butcher <adam@jessamine.co.uk>
25
26 * parser.c (make_generic_type_name): Spell generic type names '<autoN>'
27 rather than '__GenN'.
28
29 2013-09-23 Adam Butcher <adam@jessamine.co.uk>
30
31 * lambda.c (maybe_add_lambda_conv_op): Don't check for instantiated
32 callop in the case of generic lambdas.
33
34 2013-09-23 Adam Butcher <adam@jessamine.co.uk>
35
36 * parser.c (make_generic_type_name): Use global count rather than
37 parameter and ...
38 (add_implicit_template_parms): ... propagate interface change here.
39
40 2013-09-20 Paolo Carlini <paolo.carlini@oracle.com>
41
42 PR c++/58481
43 * pt.c (tsubst_copy): Use current_nonlambda_class_type to
44 call tsubst_baselink.
45
46 2013-09-18 Paolo Carlini <paolo.carlini@oracle.com>
47
48 PR c++/58457
49 * class.c (instantiate_type): Loosen a bit the gcc_assert.
50
51 2013-09-18 Marek Polacek <polacek@redhat.com>
52
53 PR sanitize/58443
54 * typeck.c (cp_build_binary_op): Properly honor -fsanitize options.
55 Remove unnecessary check.
56
57 2013-09-18 Marek Polacek <polacek@redhat.com>
58
59 PR sanitizer/58411
60 * typeck.c (cp_build_binary_op): Don't sanitize function if it has the
61 no_sanitize_undefined attribute.
62
63 2013-09-17 Paolo Carlini <paolo.carlini@oracle.com>
64
65 PR c++/58435
66 * pt.c (tsubst, [BOUND_TEMPLATE_TEMPLATE_PARM]): Take into account
67 the cp_type_quals (r) too.
68
69 2013-09-16 Adam Butcher <adam@jessamine.co.uk>
70
71 * cp-tree.h (type_uses_auto_or_concept): Declare.
72 (is_auto_or_concept): Declare.
73 * decl.c (grokdeclarator): Allow 'auto' parameters in lambdas with
74 -std=gnu++1y or -std=c++1y or, as a GNU extension, in plain functions.
75 * type-utils.h: New header defining ...
76 (find_type_usage): ... this new function based on pt.c (type_uses_auto)
77 for searching a type tree given a predicate.
78 * pt.c (type_uses_auto): Reimplement via type-utils.h (find_type_usage).
79 (is_auto_or_concept): New function.
80 (type_uses_auto_or_concept): New function.
81 * parser.h (struct cp_parser): Add fully_implicit_function_template_p.
82 * parser.c (cp_parser_new): Initialize
83 fully_implicit_function_template_p.
84 (cp_parser_new): Initialize fully_implicit_function_template_p.
85 (cp_parser_lambda_expression): Copy and restore value of
86 fully_implicit_function_template_p as per other parser fields.
87 (cp_parser_parameter_declaration_list): Count generic
88 parameters and call ...
89 (add_implicit_template_parms): ... this new function to synthesize them
90 with help from type-utils.h (find_type_usage), ...
91 (tree_type_is_auto_or_concept): ... this new static function and ...
92 (make_generic_type_name): ... this new static function.
93 (cp_parser_direct_declarator): Account for implicit template parameters.
94 (cp_parser_lambda_declarator_opt): Finish fully implicit template if
95 necessary by calling ...
96 (finish_fully_implicit_template): ... this new function.
97 (cp_parser_init_declarator): Likewise.
98 (cp_parser_function_definition_after_declarator): Likewise.
99 (cp_parser_member_declaration): Likewise.
100 * Make-lang.in (cp/pt.o): Add dependency on type-utils.h.
101 (cp/parser.o): Likewise.
102
103 2013-09-16 Adam Butcher <adam@jessamine.co.uk>
104
105 * parser.c (cp_parser_lambda_declarator_opt): Accept template parameter
106 list with std=c++1y or std=gnu++1y.
107 (cp_parser_lambda_body): Don't call 'expand_or_defer_fn' for lambda call
108 operator template to avoid adding template result to symbol table.
109 * lambda.c (lambda_function): Return template result if call operator is
110 a template.
111 (maybe_add_lambda_conv_op): Move declarations to point of use. Refactor
112 operator call building in order to support conversion of a non-capturing
113 lambda template to a function pointer with help from ...
114 (prepare_op_call): ... this new function.
115 * decl2.c (check_member_template): Don't reject lambda call operator
116 template in local [lambda] class.
117 * pt.c (instantiate_class_template_1): Don't instantiate lambda call
118 operator template when instantiating lambda class.
119
120 2013-09-16 Adam Butcher <adam@jessamine.co.uk>
121
122 * pt.c (make_auto_1): Use input_location rather than BUILTINS_LOCATION.
123
124 2013-09-15 Jason Merrill <jason@redhat.com>
125
126 Core DR 904
127 PR c++/41933
128 * parser.c (cp_parser_lambda_introducer): Handle variadic capture.
129 * lambda.c (add_capture): Handle variadic capture.
130 (add_default_capture, lambda_capture_field_type): Likewise.
131 (build_capture_proxy, register_capture_members): Likewise.
132 * pt.c (register_specialization): Allow FIELD_DECL.
133 (retrieve_specialization): Likewise.
134 (find_parameter_packs_r): Handle FIELD_DECL and VAR_DECL.
135 (tsubst_pack_expansion): Handle FIELD_DECL packs.
136 (gen_elem_of_pack_expansion_instantiation): Likewise.
137 (instantiate_class_template_1): Likewise.
138 (tsubst_decl, tsubst_copy): Likewise.
139 (tsubst_expr) [DECL_EXPR]: Handle capture proxy packs.
140 (tsubst_copy_and_build) [VAR_DECL]: Likewise.
141 * semantics.c (finish_non_static_data_member): Don't try to represent
142 the type of a COMPOUND_REF of a FIELD_DECL pack.
143
144 PR c++/41933
145 * cp-tree.h (DECL_PACK_P): Replace FUNCTION_PARAMETER_PACK_P.
146 * cxx-pretty-print.c (direct_declarator): Adjust.
147 * decl2.c (cp_build_parm_decl): Adjust.
148 * pt.c (function_parameter_pack_p): Adjust.
149 (find_parameter_packs_r, push_template_decl_real): Adjust.
150 (tsubst_pack_expansion, tsubst_decl): Adjust.
151 (regenerate_decl_from_template, instantiate_decl): Adjust.
152
153 * lambda.c (add_capture): Don't add DECL_LANG_SPECIFIC.
154
155 2013-09-13 Jason Merrill <jason@redhat.com>
156
157 PR c++/58273
158 * pt.c (any_type_dependent_elements_p): Actually check for
159 type-dependence, not value-dependence.
160
161 2013-09-13 Jacek Caban <jacek@codeweavers.com>
162
163 * decl.c: Use new cxx_implicit_extern_c hook
164
165 2013-09-12 Brooks Moses <bmoses@google.com>
166
167 PR driver/42955
168 * Make-lang.in: Do not install driver binaries in $(target)/bin.
169
170 2013-09-12 Adam Butcher <adam@jessamine.co.uk>
171
172 * pt.c (instantiate_decl): Save/restore cp_unevaluated_operand and
173 c_inhibit_evaluation_warnings. Reset if instantiating within a
174 function-local template.
175
176 2013-09-12 Paolo Carlini <paolo.carlini@oracle.com>
177
178 * semantics.c (finish_pseudo_destructor_expr): Add location_t
179 parameter.
180 * pt.c (unify_arg_conversion): Use EXPR_LOC_OR_HERE.
181 (tsubst_copy_and_build): Adjust finish_pseudo_destructor_expr
182 calls.
183 * parser.c (cp_parser_postfix_dot_deref_expression): Likewise.
184 (cp_parser_postfix_expression): Pass the proper location to
185 cp_parser_postfix_dot_deref_expression.
186 * cp-tree.h (finish_pseudo_destructor_expr): Update declaration.
187
188 2013-09-10 Jan Hubicka <jh@suse.cz>
189 Paolo Carlini <paolo.carlini@oracle.com>
190
191 * error.c (print_instantiation_partial_context_line): If
192 loc == UNKNOWN_LOCATION return immediately.
193
194 2013-09-09 Jakub Jelinek <jakub@redhat.com>
195
196 PR c++/58325
197 * init.c (build_vec_delete): Call mark_rvalue_use on base.
198
199 2013-09-09 Paolo Carlini <paolo.carlini@oracle.com>
200
201 PR c++/43452
202 * init.c (build_vec_delete_1): When the type is incomplete emit a
203 warning, enabled by default (not an error).
204 (build_delete): Adjust to use OPT_Wdelete_incomplete.
205
206 2013-09-09 Paolo Carlini <paolo.carlini@oracle.com>
207
208 PR c++/58362
209 * error.c (location_of): Don't handle PARM_DECLs specially.
210
211 2013-09-09 Paolo Carlini <paolo.carlini@oracle.com>
212
213 * error.c (dump_expr, [PSEUDO_DTOR_EXPR]): Fix.
214 * cxx-pretty-print.c (cxx_pretty_printer::postfix_expression):
215 Tweak, TREE_OPERAND (t, 1) may be null.
216
217 2013-09-08 Caroline Tice <cmtice@google.com>
218
219 PR c++/58300
220 * vtable-class-hierarchy.c (vtv_generate_init_routine): In
221 preinit case, move call to assemble_vtv_preinit_initializer to
222 after call to cgraph_process_new_functions.
223
224 2013-09-08 Tom de Vries <tom@codesourcery.com>
225
226 PR c++/58282
227 * except.c (build_must_not_throw_expr): Handle
228 flag_exceptions.
229
230 2013-09-08 Joern Rennecke <joern.rennecke@embecosm.com>
231
232 * typeck.c (cp_build_binary_op): Use vector_types_compatible_elements_p.
233
234 2013-09-04 Paolo Carlini <paolo.carlini@oracle.com>
235
236 PR c++/24926
237 * class.c (finish_struct_anon_r): New.
238 (finish_struct_anon): Use it.
239
240 2013-09-04 Gabriel Dos Reis <gdr@integrable-solutions.net>
241
242 * cxx-pretty-print.h (cxx_pretty_printer::simple_type_specifier):
243 Declare as overrider.
244 * cxx-pretty-print.c (cxx_pretty_printer::simple_type_specifier):
245 Rename from pp_cxx_simple_type_specifier.
246 (cxx_pretty_printer::cxx_pretty_printer): Do not assign to
247 simple_type_specifier.
248
249 2013-09-03 Paolo Carlini <paolo.carlini@oracle.com>
250
251 PR c++/58305
252 * typeck2.c (build_functional_cast): Maybe warn_deprecated_use.
253
254 2013-09-03 Mike Stump <mikestump@comcast.net>
255
256 * Make-lang.in (cp/lambda.o): Add dependencies.
257
258 2013-09-03 Gabriel Dos Reis <gdr@integrable-solutions.net>
259
260 * cxx-pretty-print.h (cxx_pretty_printer::type_id): Declare as
261 overrider.
262 * cxx-pretty-print.c (pp_cxx_storage_class_specifier): Remove.
263 (pp_cxx_userdef_literal): Tidy.
264 (pp_cxx_template_argument_list): Likewise.
265 (pp_cxx_typeid_expression): Likewise.
266 (pp_cxx_offsetof_expression_1): Likewise.
267 (cxx_pretty_printer::postfix_expression): Likewise.
268 (cxx_pretty_printer::unary_expression): Likewise.
269 (cxx_pretty_printer::statement): Likewise.
270 (cxx_pretty_printer::type_id): Rename from pp_cxx_type_id.
271 (c_pretty_printer::cxx_pretty_printer): Do not assign to type_id.
272 * error.c (dump_decl): Tidy.
273 (dump_expr): Likewise.
274
275 2013-09-02 Paolo Carlini <paolo.carlini@oracle.com>
276
277 PR c++/21682, implement DR 565
278 * name-lookup.c (compparms_for_decl_and_using_decl): New.
279 (push_overloaded_decl_1, do_nonmember_using_decl): Use it.
280
281 2013-08-30 Marek Polacek <polacek@redhat.com>
282
283 * typeck.c (cp_build_binary_op): Add division by zero and shift
284 instrumentation.
285 * error.c (dump_expr): Special-case ubsan builtins.
286
287 2013-08-30 Paolo Carlini <paolo.carlini@oracle.com>
288
289 PR c++/51424
290 * cp-tree.h (LOOKUP_DELEGATING_CONS): Add.
291 * init.c (perform_target_ctor): Use it.
292 * call.c (build_special_member_call): Diagnose self-delegating
293 constructors.
294
295 2013-08-30 Gabriel Dos Reis <gdr@integrable-solutions.net>
296
297 * cxx-pretty-print.h (cxx_pretty_printer::declaration): Declare as
298 overrider.
299 (cxx_pretty_printer::declaration_specifiers): Likewise.
300 (cxx_pretty_printer::function_specifier): Likewise.
301 (cxx_pretty_printer::declarator): Likewise.
302 (cxx_pretty_printer::direct_declarator): Likewise.
303 (cxx_pretty_printer::abstract_declarator): Likewise.
304 (cxx_pretty_printer::direct_abstract_declarator): Likewise.
305 (pp_cxx_declaration): Remove.
306 * cxx-pretty-print.c (cxx_pretty_printer::function_specifier):
307 Rename from pp_cxx_function_specifier. Adjust.
308 (cxx_pretty_printer::declaration_specifiers): Rename from
309 pp_cxx_decl_specifier_seq. Adjust.
310 (cxx_pretty_printer::direct_declarator): Rename from
311 pp_cxx_direct_declarator. Adjust.
312 (cxx_pretty_printer::declarator): Rename from pp_cxx_declarator.
313 Adjust.
314 (cxx_pretty_printer::abstract_declarator): Rename from
315 pp_cxx_abstract_declarator. Adjust.
316 (cxx_pretty_printer::direct_abstract_declarator): Rename from
317 pp_cxx_direct_abstract_declarator. Adjust.
318 (cxx_pretty_printer::declaration): Rename from
319 pp_cxx_declaration. Adjust.
320 (cxx_pretty_printer::cxx_pretty_printer): Do not assign to
321 declaration, declaration_specifiers, function_specifier,
322 declarator, direct_declarator, abstract_declarator,
323 direct_abstract_declarator.
324 * error.c (dump_decl): Adjust.
325
326 2013-08-29 Jan Hubicka <jh@suse.cz>
327
328 Correct previous patch to not mark terminate as LEAF.
329 * class.c (build_vtbl_initializer): Drop LEAF
330 * decl.c (cxx_init_decl_processing): Likewise.
331 (push_throw_library_fn): Likewise.
332 * except.c (init_exception_processing): Likewise.
333 (do_begin_catch): Likewise.
334 (do_end_catch): Likewise.
335 (do_allocate_exception): Likewise.
336
337 2013-08-29 Jan Hubicka <jh@suse.cz>
338
339 * class.c (build_vtbl_initializer): Make __cxa_deleted_virtual
340 ECF_NORETURN | ECF_LEAF
341 * cp-tree.h (build_library_fn_ptr, build_cp_library_fn_ptr,
342 push_library_fn, push_void_library_fn): Update prototype.
343 * decl.c (build_library_fn_1): Remove.
344 (push_cp_library_fn, build_cp_library_fn): Update to take ECF flags.
345 (cxx_init_decl_processing): Update; global_delete_fndecl is ECF_NOTROW;
346 __cxa_pure_virtual is ECF_NORETURN | ECF_NORETURN | ECF_LEAF.
347 (build_library_fn_1): Add ecf_flags argument; rename to ...
348 (build_library_fn): ... this one.
349 (build_cp_library_fn): Take ecf_flags; do not copy NOTHROW flag.
350 (build_library_fn_ptr): Take ecf_flags.
351 (build_cp_library_fn_ptr): Likewise.
352 (push_library_fn): Likewise.
353 (push_cp_library_fn): Likewise.
354 (push_void_library_fn): Likewise.
355 (push_throw_library_fn): All throws are ECF_NORETURN.
356 (__cxa_atexit, __cxa_thread_atexit): Add ECF_LEAF | ECF_NOTHROW attributes.
357 (expand_static_init): __cxa_guard_acquire, __cxa_guard_release,
358 __cxa_guard_abort are ECF_NOTHROW | ECF_LEAF.
359 * except.c (init_exception_processing): terminate is
360 ECF_NOTHROW | ECF_NORETURN | ECF_LEAF.
361 (declare_nothrow_library_fn): Add ecf_flags parameter.
362 (__cxa_get_exception_ptr): Is ECF_NOTHROW | ECF_PURE | ECF_LEAF |
363 ECF_TM_PURE.
364 (do_begin_catch): cxa_begin_catch and _ITM_cxa_begin_catch
365 are ECF_NOTHROW | ECF_LEAF.
366 (do_end_catch): __cxa_end_catch and _ITM_cxa_end_catch is
367 ECF_LEAF.
368 (do_allocate_exception): _cxa_allocate_exception
369 and _ITM_cxa_allocate_exception are ECF_NOTHROW | ECF_MALLOC
370 | ECF_LEAF
371 (do_free_exception): __cxa_free_exception is
372 ECF_NOTHROW | ECF_LEAF.
373 * rtti.c (build_dynamic_cast_1): __dynamic_cast
374 is ECF_LEAF | ECF_PURE | ECF_NOTHROW.
375
376 2013-08-29 Adam Butcher <adam@jessamine.co.uk>
377
378 * error.c (dump_lambda_function): New function, dependent on ...
379 (dump_substitution): ... this new function, factored out of ...
380 (subst_to_string): ... here and ...
381 (dump_function_decl): ... here. Updated to early-out with call to
382 dump_lambda_function after determining template bindings.
383
384 2013-08-28 Paolo Carlini <paolo.carlini@oracle.com>
385
386 PR c++/58255
387 * init.c (build_aggr_init): When init == void_type_node do not
388 set LOOKUP_ONLYCONVERTING.
389
390 2013-08-27 Caroline Tice <cmtice@google.com>
391
392 * vtable-class-hierarchy.c: Remove unnecessary include statements.
393 (MAX_SET_SIZE): Remove unnecessary constant.
394 (register_construction_vtables): Make vtable_ptr_array parameter
395 into a vector; remove num_args parameter. Change array accesses to
396 vector accesses.
397 (register_other_binfo_vtables): Ditto.
398 (insert_call_to_register_set): Ditto.
399 (insert_call_to_register_pair): Ditto.
400 (output_set_info): Ditto. Also change warning calls to warning_at
401 calls, and fix format of warning messages.
402 (register_all_pairs): Change vtbl_ptr_array from an array into a
403 vector. Remove num_vtable_args (replace with calls to vector length).
404 Change array stores & accesses to vector functions. Change calls to
405 register_construction_vtables, register_other_binfo_vtables,
406 insert_call_to_register_set, insert_call_to_register_pair and
407 output_set_info to match their new signatures. Change warning to
408 warning_at and fix the format of the warning message.
409
410 2013-08-27 Jakub Jelinek <jakub@redhat.com>
411 Aldy Hernandez <aldyh@redhat.com>
412
413 * cp-tree.h (CP_OMP_CLAUSE_INFO): Adjust range for new clauses.
414
415 2013-08-27 Paolo Carlini <paolo.carlini@oracle.com>
416
417 * decl.c (grokfndecl): Remove old bison hack.
418
419 2013-08-26 Jan Hubicka <jh@suse.cz>
420
421 * cp-tree.h (DECL_CONSTRUCTOR_P, DECL_DESTRUCTOR_P): Use
422 middle-end flag.
423
424 2013-08-26 Gabriel Dos Reis <gdr@integrable-solutions.net>
425
426 * cxx-pretty-print.h (cxx_pretty_printer::unary_expression):
427 Declare as overrider.
428 (cxx_pretty_printer::multiplicative_expression): Likewise.
429 (cxx_pretty_printer::conditional_expression): Likewise.
430 (cxx_pretty_printer::assignment_expression): Likewise.
431 (cxx_pretty_printer::expression): Likewise.
432 * cxx-pretty-print.c (cxx_pretty_printer::unary_expression):
433 Rename from pp_cxx_unary_expression. Adjust.
434 (cxx_pretty_printer::multiplicative_expression): Rename from
435 pp_cxx_multiplicative_expression. Adjust.
436 (cxx_pretty_printer::conditional_expression): Rename from
437 pp_cxx_conditional_expression. Adjust.
438 (cxx_pretty_printer::assignment_expression): Rename from
439 pp_cxx_assignment_expression. Adjust.
440 (cxx_pretty_printer::expression): Rename from pp_cxx_expression.
441 Adjust.
442 (cxx_pretty_printer::cxx_pretty_printer): Dot not assign to
443 unary_expression, multiplicative_expression,
444 conditional_expression, assignment_expression, expression.
445
446 2013-08-25 Gabriel Dos Reis <gdr@integrable-solutions.net>
447
448 * cxx-pretty-print.h (cxx_pretty_printer::postfix_expression):
449 Declare as overrider.
450 * cxx-pretty-print.c (cxx_pretty_printer::postfix_expression):
451 Rename from pp_cxx_postfix_expression. Adjust.
452 (pp_cxx_expression): Use pp_postfix_expression.
453 (cxx_pretty_printer::cxx_pretty_printer): Do not assign to
454 postfix_expression.
455
456 2013-08-25 Gabriel Dos Reis <gdr@integrable-solutions.net>
457
458 * cxx-pretty-print.h (cxx_pretty_printer::primary_expression): Now
459 an overrider of c_pretty_printer::primary_expression.
460 * cxx-pretty-print.c (cxx_pretty_printer::primary_expression):
461 Rename from pp_cxx_primary_expression. Adjust.
462 (pp_cxx_postfix_expression): Use pp_primary_expression.
463 (pp_cxx_ctor_initializer): Likewise.
464 (cxx_pretty_printer::cxx_pretty_printer): Do not assign to
465 primary_expression.
466
467 2013-08-23 Jan Hubicka <jh@suse.cz>
468
469 * cp-tree.h (struct lang_type_class): Free is_final bit.
470 (CLASSTYPE_FINAL): Define using TYPE_FINAL_P.
471 (DECL_FINAL_P): Remove.
472 * pt.c (instantiate_class_template_1): Guard that CLASSTYPE_FINAL
473 is called on CLASS_TYPE_P.
474
475 2013-08-25 Gabriel Dos Reis <gdr@integrable-solutions.net>
476
477 * cxx-pretty-print.c (M_): Remove.
478 (pp_cxx_unqualified_id): Use translate_string instead of M_.
479 (pp_cxx_canonical_template_parameter): Likewise.
480
481 2013-08-24 Gabriel Dos Reis <gdr@integrable-solutions.net>
482
483 * cxx-pretty-print.h (cxx_pretty_printer::id_expression): Declare.
484 * cxx-pretty-print.c (cxx_pretty_printer::id_expression): Rename
485 from pp_cxx_id_expression. Adjust.
486 (pp_cxx_userdef_literal): Use pp_id_expression.
487 (pp_cxx_primary_expression): Likewise.
488 (pp_cxx_direct_declarator): Likewise.
489 (cxx_pretty_printer::cxx_pretty_printer): Do not assign to
490 id_expression.
491
492 2013-08-24 Gabriel Dos Reis <gdr@integrable-solutions.net>
493
494 * cxx-pretty-print.h (cxx_pretty_printer::constant): Now a member
495 function, overriding c_pretty_printer::constant.
496 * cxx-pretty-print.c (cxx_pretty_printer::constant): Rename from
497 pp_cxx_constant. Adjust.
498 (cxx_pretty_printer::cxx_pretty_printer): Do not assign to constant.
499
500 2013-08-23 Gabriel Dos Reis <gdr@integrable-solutiobs.net>
501
502 * cp-objcp-common.c (cxx_initialize_diagnostics): Call a
503 destructor for the early printer.
504 * error.c (type_to_string): Use pp_buffer.
505
506 2013-08-22 Paolo Carlini <paolo.carlini@oracle.com>
507
508 PR c++/56380
509 * class.c (check_field_decls): Check for const mutable and const
510 reference data members.
511
512 2013-08-22 Gabriel Dos Reis <gdr@integrable-solutions.net>
513
514 * error.c (init_error): Remove calls to pp_construct and
515 pp_cxx_pretty_printer_init. Initialize cxx_pp with placement-new.
516 * cxx-pretty-print.h (cxx_pretty_printer::cxx_pretty_printer): Declare.
517 (cxx_pretty_printer_init): Remove.
518 * cxx-pretty-print.c (cxx_pretty_printer::cxx_pretty_printer):
519 Rename from cxx_pretty_printer_init. Adjust.
520 * cp-objcp-common.c (cxx_initialize_diagnostics): Simplify
521 initialization of C++ diagnostics pretty printer.
522
523 2013-08-21 Paolo Carlini <paolo.carlini@oracle.com>
524
525 * call.c (build_new_method_call_1): Use INDIRECT_REF_P.
526 * cp-tree.h (REFERENCE_REF_P): Likewise.
527 * semantics.c (finish_offsetof): Likewise.
528
529 2013-08-21 Paolo Carlini <paolo.carlini@oracle.com>
530
531 PR c++/56130
532 * semantics.c (finish_id_expression): Handle deprecated references.
533
534 2013-08-20 Jason Merrill <jason@redhat.com>
535
536 PR c++/58119
537 * cvt.c (build_expr_type_conversion): Don't complain about a
538 template that can't match the desired type category.
539
540 2013-08-20 Gabriel Dos Reis <gdr@integrable-solutions.net>
541
542 * error.c (pp_ggc_formatted_text): New.
543 (type_as_string): Use it in lieu of pp_formatted_text.
544 (type_as_string_translate): Likewise.
545 (expr_as_string): Likewise.
546 (decl_as_string): Likewise.
547 (decl_as_string_translate): Likewise.
548 (lang_decl_name): Likewise.
549 (decl_to_string): Likewise.
550 (expr_to_string): Likewise.
551 (fndecl_to_string): Likewise.
552 (parm_to_string): Likewise.
553 (type_to_string): Likewise.
554 (args_to_string): Likewise.
555 (subst_to_string): Likewise.
556
557 2013-08-19 Balaji V. Iyer <balaji.v.iyer@intel.com>
558
559 PR c/57490
560 * cp-array-notation.c (cp_expand_cond_array_notations): Added a
561 check for truth values.
562 (expand_array_notation_exprs): Added truth values case. Removed an
563 unwanted else. Added for-loop to walk through subtrees in default
564 case.
565 * call.c (build_cxx_call): Inherited the type of the array notation for
566 certain built-in array notation functions.
567
568 2013-08-19 Paolo Carlini <paolo.carlini@oracle.com>
569
570 * parser.c (cp_parser_lambda_introducer, cp_parser_decltype_expr):
571 Use cp_parser_lookup_name_simple.
572
573 2013-08-19 Paolo Carlini <paolo.carlini@oracle.com>
574
575 * name-lookup.h (pop_bindings_and_leave_scope): Declare.
576 * name-lookup.c (pop_bindings_and_leave_scope): Define.
577 * parser.c (cp_parser_lambda_declarator_opt,
578 cp_parser_direct_declarator, cp_parser_cache_defarg): Use it.
579
580 2013-08-17 Jason Merrill <jason@redhat.com>
581
582 PR c++/58083
583 * name-lookup.c (push_class_level_binding_1): It's OK to push a
584 lambda type after the enclosing type is complete.
585
586 2013-08-17 Gabriel Dos Reis <gdr@integrable-solutions.net>
587
588 * error.c (dump_scope): Add a cxx_pretty_printer parameter.
589 Adjust callers.
590 (dump_template_argument): Likewise.
591 (dump_template_argument_list): Likewise.
592 (dump_template_parameter): Likewise.
593 (dump_template_bindings): Likewise.
594 (dump_alias_template_specialization): Likewise.
595 (dump_type): Likewise.
596 (dump_typename): Likewise.
597 (dump_aggr_type): Likewise.
598 (dump_type_prefix): Likewise.
599 (dump_type_suffix): Likewise.
600 (dump_global_iord): Likewise.
601 (dump_simple_decl): Likewise.
602 (dump_decl): Likewise.
603 (dump_template_decl): Likewise.
604 (dump_function_decl): Likewise.
605 (dump_parameters): Likewise.
606 (dump_ref_qualifier): Likewise.
607 (dump_exception_spec): Likewise.
608 (dump_function_name): Likewise.
609 (dump_template_parms): Likewise.
610 (dump_call_expr_args): Likewise.
611 (dump_aggr_init_expr_args): Likewise.
612 (dump_expr_list): Likewise.
613 (dump_expr_init_vec): Likewise.
614 (dump_expr): Likewise.
615 (dump_binary_op): Likewise.
616 (dump_unary_op): Likewise.
617
618 2013-08-14 Paolo Carlini <paolo.carlini@oracle.com>
619
620 PR c++/51912
621 * cp-tree.h (LOOKUP_NO_NON_INTEGRAL): Add.
622 * decl.c (case_conversion): Use it.
623 * call.c (standard_conversion): Likewise.
624 (implicit_conversion): Adjust.
625
626 2013-08-13 Adam Butcher <adam@jessamine.co.uk>
627
628 * pt.c: Grammar fix in comments ("it's" to "its").
629
630 2013-08-12 Paolo Carlini <paolo.carlini@oracle.com>
631
632 * decl.c (warn_extern_redeclared_static, duplicate_decls,
633 check_elaborated_type_specifier): Use error + inform.
634 * friend.c (make_friend_class): Likewise.
635 * semantics.c (finish_id_expression): Likewise.
636
637 2013-08-09 Paolo Carlini <paolo.carlini@oracle.com>
638
639 Revert:
640 2013-08-07 Paolo Carlini <paolo.carlini@oracle.com>
641
642 PR c++/46206
643 * name-lookup.c (lookup_name_real_1): Handle iter->type before
644 iter->value.
645
646 2013-08-07 Paolo Carlini <paolo.carlini@oracle.com>
647
648 PR c++/46206
649 * name-lookup.c (lookup_name_real_1): Handle iter->type before
650 iter->value.
651
652 2013-08-06 Caroline Tice <cmtice@google.com>
653
654 * Make-lang.in (*CXX_AND_OBJCXX_OBJS): Add vtable-class-hierarchy.o to
655 list.
656 (vtable-class-hierarchy.o): Add build rule.
657 * cp-tree.h (vtv_start_verification_constructor_init_function): New
658 extern function decl.
659 (vtv_finish_verification_constructor_init_function): New extern
660 function decl.
661 (build_vtbl_address): New extern function decl.
662 (get_mangled_vtable_map_var_name): New extern function decl.
663 (vtv_compute_class_hierarchy_transitive_closure): New extern function
664 decl.
665 (vtv_generate_init_routine): New extern function decl.
666 (vtv_save_class_info): New extern function decl.
667 (vtv_recover_class_info): New extern function decl.
668 (vtv_build_vtable_verify_fndecl): New extern function decl.
669 * class.c (finish_struct_1): Add call to vtv_save_class_info if
670 flag_vtable_verify is true.
671 * config-lang.in: Add vtable-class-hierarchy.c to gtfiles list.
672 * vtable-class-hierarchy.c: New file.
673 * mangle.c (get_mangled_vtable_map_var_name): New function.
674 * decl2.c (start_objects): Update function comment.
675 (cp_write_global_declarations): Call vtv_recover_class_info,
676 vtv_compute_class_hierarchy_transitive_closure and
677 vtv_build_vtable_verify_fndecl, before calling
678 finalize_compilation_unit, and call vtv_generate_init_rount after, IFF
679 flag_vtable_verify is true.
680 (vtv_start_verification_constructor_init_function): New function.
681 (vtv_finish_verification_constructor_init_function): New function.
682 * init.c (build_vtbl_address): Remove static qualifier from function.
683
684 2013-08-06 Jason Merrill <jason@redhat.com>
685
686 PR c++/57825
687 * tree.c (strip_typedefs) [METHOD_TYPE]: Preserve ref-qualifier.
688
689 2013-08-05 Paolo Carlini <paolo.carlini@oracle.com>
690
691 PR c++/58080
692 * typeck.c (cp_pointer_int_sum): Add tsubst_flags_t parameter.
693 (cp_build_binary_op): Adjust.
694
695 2013-08-04 Gabriel Dos Reis <gdr@integrable-solutions.net>
696
697 * cxx-pretty-print.h (pp_c_base): Remove.
698 (cxx_pretty_printer): Derive from c_pretty_printer.
699 Adjust macros using pp_c_base.
700 * cp-objcp-common.c (cxx_initialize_diagnostics): Do not call pp_base.
701 * cxx-pretty-print.c (pp_cxx_nonconsecutive_character): Likewise.
702 (pp_cxx_colon_colon): Likewise.
703 (pp_cxx_separate_with): Likewise.
704 (pp_cxx_storage_class_specifier): Do not call pp_c_base.
705 (pp_cxx_expression_list): Likewise.
706 (pp_cxx_space_for_pointer_operator): Likewise.
707 (pp_cxx_init_declarator): Likewise.
708 (pp_cxx_call_argument_list): Likewise.
709 (pp_cxx_constant): Likewise.
710 (pp_cxx_postfix_expression): Likewise.
711 (pp_cxx_new_expression): Likewise.
712 (pp_cxx_unary_expression): Likewise.
713 (pp_cxx_cast_expression): Likewise.
714 (pp_cxx_conditional_expression): Likewise.
715 (pp_cxx_assignment_expression): Likewise.
716 (pp_cxx_expression): Likewise.
717 (pp_cxx_function_specifier): Likewise.
718 (pp_cxx_decl_specifier_seq): Likewise.
719 (pp_cxx_simple_type_specifier): Likewise.
720 (pp_cxx_type_specifier_seq): Likewise.
721 (pp_cxx_ptr_operator): Likewise.
722 (pp_cxx_parameter_declaration_clause): Likewise.
723 (pp_cxx_direct_declarator): Likewise.
724 (pp_cxx_direct_abstract_declarator): Likewise.
725 (pp_cxx_type_id): Likewise.
726 (pp_cxx_statement): Likewise.
727 (pp_cxx_pretty_printer_init): Tidy.
728 * error.c (init_error): Do not use pp_base.
729 (dump_aggr_type): Likewise.
730 (dump_type_prefix): Likewise.
731 (dump_type_suffix): Likewise.
732 (dump_global_iord): Likewise.
733 (dump_decl): Likewise.
734 (dump_function_decl): Likewise.
735 (dump_ref_qualifier): Likewise.
736 (reinit_cxx_pp): Likewise.
737 (decl_as_dwarf_string): Likewise.
738 (lang_decl_dwarf_name): Likewise.
739 (type_to_string): Likewise.
740 (cv_to_string): Likewise.
741 (cxx_print_error_function): Likewise.
742 (cp_diagnostic_starter): Likewise.
743 (cp_diagnostic_finalizer): Likewise.
744 (cp_print_error_function): Likewise.
745 (print_instantiation_context): Likewise.
746 (cp_printer): Likewise.
747
748 2013-08-03 Gabriel Dos Reis <gdr@integrable-solutions.net>
749
750 * error.c (dump_type_prefix): Use specialized pretty printer
751 functions instead of pp_string or operators and punctuators.
752 (dump_decl): Likewise.
753 (dump_expr): Likewise.
754
755 2013-08-03 Jason Merrill <jason@redhat.com>
756
757 DR 1286
758 * pt.c (get_underlying_template): New.
759 (convert_template_argument, lookup_template_class_1): Use it.
760
761 DR 1430
762 PR c++/51239
763 * pt.c (pack_expansion_args_count): Rename from
764 any_pack_expanson_args_p.
765 (coerce_template_parms): Reject pack expansion to
766 non-pack template parameter of alias template.
767
768 2013-08-03 Gabriel Dos Reis <gdr@integrable-solutions.net>
769
770 * error.c (dump_aggr_type): Use specialized pretty printer
771 functions instead of pp_character.
772 (dump_type_prefix): Likewise.
773 (dump_simple_decl): Likewise.
774 (type_to_string): Likewise.
775
776 2013-08-02 Paolo Carlini <paolo.carlini@oracle.com>
777
778 * cp-tree.h (finish_stmt): Do not declare.
779 * decl.c (finish_stmt): Do not define.
780 * parser.c (cp_parser_expression_statement,
781 cp_parser_declaration_statement,
782 cp_parser_transaction_cancel): Don't call finish_stmt.
783 * semantics.c (finish_expr_stmt, finish_if_stmt,
784 finish_while_stmt, finish_do_stmt, finish_return_stmt,
785 finish_for_stmt, finish_switch_stmt, finish_compound_stmt,
786 finish_transaction_stmt): Likewise.
787
788 2013-08-01 Fabien Chêne <fabien@gcc.gnu.org>
789
790 PR c++/54537
791 * cp-tree.h: Check OVL_USED with OVERLOAD_CHECK.
792 * name-lookup.c (do_nonmember_using_decl): Make sure we have an
793 OVERLOAD before calling OVL_USED. Call diagnose_name_conflict
794 instead of issuing an error without mentioning the conflicting
795 declaration.
796
797 2013-07-31 Paolo Carlini <paolo.carlini@oracle.com>
798
799 * parser.c (cp_parser_sizeof_pack): Check cp_parser_identifier
800 return value for error_mark_node.
801
802 2013-07-30 Paolo Carlini <paolo.carlini@oracle.com>
803
804 PR c++/57673
805 * parser.c (cp_parser_cache_defarg): In an NSDMI don't stop when
806 token->type == CPP_ELLIPSIS.
807
808 2013-07-30 Paolo Carlini <paolo.carlini@oracle.com>
809
810 PR c++/57947
811 * call.c (is_std_init_list): Return false if cxx_dialect == cxx98.
812
813 2013-07-29 Jason Merrill <jason@redhat.com>
814
815 PR c++/57901
816 * semantics.c (build_data_member_initialization, constexpr_fn_retval):
817 Use break_out_target_exprs instead of unshare_expr.
818
819 2013-07-29 Paolo Carlini <paolo.carlini@oracle.com>
820
821 PR c++/57948
822 * call.c (initialize_reference): Don't crash when reference_binding
823 returns a conv with conv->kind == ck_ambig.
824
825 2013-07-29 Jason Merrill <jason@redhat.com>
826
827 * mangle.c (write_name): Check for null context.
828 (write_unscoped_name): Allow PARM_DECL context.
829
830 2013-07-25 Paolo Carlini <paolo.carlini@oracle.com>
831
832 PR c++/57981
833 * decl.c (check_default_argument): Take a tsubst_flags_t parameter.
834 (grokparms): Adjust.
835 * parser.c (cp_parser_late_parse_one_default_arg): Likewise.
836 * pt.c (tsubst_default_argument, tsubst_default_arguments): Take
837 a tsubst_flags_t parameter.
838 (tsubst_decl): Adjust.
839 * call.c (convert_default_arg): Likewise.
840 * cp-tree.h (check_default_argument, tsubst_default_argument):
841 Update declarations.
842
843 2013-07-25 Paolo Carlini <paolo.carlini@oracle.com>
844
845 PR c++/57880
846 * parser.c (cp_parser_operator, case CPP_WSTRING, CPP_STRING16,
847 CPP_STRING32, CPP_UTF8STRING, CPP_WSTRING_USERDEF,
848 CPP_STRING16_USERDEF, CPP_STRING32_USERDEF, CPP_UTF8STRING_USERDEF):
849 Fix string_len management, tidy.
850
851 2013-07-24 Paolo Carlini <paolo.carlini@oracle.com>
852
853 PR c++/57942
854 * typeck.c (ptr_reasonably_similar): Use COMPARE_STRICT if either
855 target type is incomplete; return a bool, not an int.
856 * cp-tree.h (ptr_reasonably_similar): Adjust declaration.
857
858 2013-07-22 Paolo Carlini <paolo.carlini@oracle.com>
859
860 * cp-tree.h (DERIVED_FROM_P): Pass tf_none to lookup_base, not
861 tf_warning_or_error.
862
863 2013-07-21 OndÅ\99ej Bílka <neleai@seznam.cz>
864
865 * class.c: Fix typos.
866 * cp-array-notation.c: Likewise.
867 * cp-objcp-common.c: Likewise.
868 * decl.c: Likewise.
869 * init.c: Likewise.
870 * mangle.c: Likewise.
871 * parser.c: Likewise.
872 * pt.c: Likewise.
873 * semantics.c: Likewise.
874
875 2013-07-14 Adam Butcher <adam@jessamine.co.uk>
876
877 * semantics.c (build_lambda_expr),
878 (build_lambda_object), (begin_lambda_type), (lambda_return_type),
879 (lambda_function), (lambda_capture_field_type), (is_capture_proxy),
880 (is_normal_capture_proxy), (insert_capture_proxy),
881 (insert_pending_capture_proxies), (lambda_proxy_type),
882 (build_capture_proxy), (vla_capture_type),
883 (register_capture_members), (add_default_capture),
884 (lambda_expr_this_capture), (maybe_resolve_dummy),
885 (nonlambda_method_basetype), (maybe_add_lambda_conv_op) and
886 (is_lambda_ignored_entity): Moved definitions into ...
887 * lambda.c: ... this new file.
888
889 2013-07-14 Marc Glisse <marc.glisse@inria.fr>
890
891 * call.c (build_conditional_expr_1): Handle the case with 1 vector
892 and 2 scalars. Call save_expr before building a vector.
893 * typeck.c (cp_build_binary_op): Check complain before complaining.
894
895 2013-07-13 Lubos Lunak <l.lunak@suse.cz>
896
897 PR c++/55203
898 * init.c (build_aggr_init): Check for warn_unused attribute.
899 * decl.c (poplevel): Likewise.
900
901 2013-07-13 Jason Merrill <jason@redhat.com>
902
903 PR c++/57402
904 * init.c (build_vec_init): Use {} for arrays of class type.
905 (build_vec_delete): Don't take the address of the array.
906
907 PR c++/57793
908 * class.c (layout_class_type): Check for too-large class.
909
910 * call.c (can_convert): Allow user-defined conversions.
911 (can_convert_standard): New.
912 * cp-tree.h: Declare it.
913 * cvt.c (convert_to_reference): Use it.
914 * pt.c (convert_nontype_argument): Likewise.
915 * search.c (check_final_overrider): Likewise.
916 Don't worry about user-defined conversions.
917
918 2013-07-10 Paolo Carlini <paolo.carlini@oracle.com>
919
920 PR c++/57869
921 * typeck.c (build_reinterpret_cast_1): With -Wconditionally-supported
922 warn about casting between pointer-to-function and pointer-to-object.
923
924 2013-07-09 Jason Merrill <jason@redhat.com>
925
926 PR c++/57402
927 * init.c (build_vec_init): Don't take shortcuts when initializing
928 a VLA.
929
930 PR c++/57471
931 * parser.c (cp_parser_sizeof_pack): Clear parser scopes.
932
933 PR c++/57658
934 * semantics.c (finish_id_expression): Return the id for an
935 unevaluated outer variable.
936
937 PR c++/57526
938 * semantics.c (lambda_capture_field_type): Build a DECLTYPE_TYPE
939 if the variable type uses 'auto'.
940
941 PR c++/57437
942 * typeck.c (check_return_expr): Lambda proxies aren't eligible
943 for nrv or return by move.
944
945 PR c++/57532
946 * parser.c (cp_parser_ref_qualifier_opt): Don't tentatively parse
947 a ref-qualifier in C++98 mode.
948
949 PR c++/57545
950 * pt.c (convert_nontype_argument) [INTEGER_CST]: Force the
951 argument to have the exact type of the parameter.
952
953 PR c++/57551
954 * semantics.c (cxx_eval_indirect_ref): Don't try to look through
955 a POINTER_PLUS_EXPR for type punning diagnostic.
956
957 PR c++/57831
958 * pt.c (tsubst_copy): Handle USING_DECL.
959
960 2013-07-09 Marc Glisse <marc.glisse@inria.fr>
961
962 PR c++/53094
963 * semantics.c (cxx_eval_bit_field_ref): Handle VECTOR_CST.
964
965 2013-07-09 Marc Glisse <marc.glisse@inria.fr>
966
967 PR c++/53000
968 * call.c (build_conditional_expr_1): Preserve xvalues.
969
970 2013-07-09 Paolo Carlini <paolo.carlini@oracle.com>
971
972 PR c++/51786
973 * parser.c (cp_parser_simple_declaration): Before calling shadow_tag
974 also check declares_class_or_enum.
975
976 2013-07-08 Jason Merrill <jason@redhat.com>
977
978 PR c++/57550
979 * pt.c (fn_type_unification): Only defer during substitution.
980 (type_unification_real): Defer during defarg substitution,
981 add checks parm to pass back deferred checks.
982 (unify, do_auto_deduction): Adjust.
983 * semantics.c (reopen_deferring_access_checks): New.
984 * cp-tree.h: Declare it.
985
986 2013-07-06 Paolo Carlini <paolo.carlini@oracle.com>
987
988 PR c++/28262
989 * parser.c (cp_parser_init_declarator): If we are parsing a typedef
990 set parser->default_arg_ok_p to false before cp_parser_declarator.
991
992 2013-07-05 Paolo Carlini <paolo.carlini@oracle.com>
993
994 PR c++/14263
995 * class.c (build_base_path): Improve diagnostic.
996
997 2013-07-04 Paolo Carlini <paolo.carlini@oracle.com>
998
999 PR c++/38634
1000 * decl.c (start_preparsed_function): Return a bool, false if
1001 push_template_decl fails.
1002 (start_function): Adjust.
1003 * cp-tree.h: Update.
1004
1005 2013-07-03 Jakub Jelinek <jakub@redhat.com>
1006
1007 PR c++/57771
1008 * parser.c (cp_parser_postfix_expression) <case RID_STATCAST>
1009 Temporarily set parser->greater_than_is_operator_p for
1010 cp_parser_expression and restore from saved value afterwards.
1011
1012 2013-06-28 Ed Smith-Rowland <3dw4rd@verizon.net>
1013
1014 * cp-tree.h (UDLIT_OP_ANSI_PREFIX): Remove space.
1015 * parser.c (cp_parser_operator()): Parse user-defined string
1016 literal as literal operator.
1017
1018 2013-06-28 Paolo Carlini <paolo.carlini@oracle.com>
1019
1020 PR c++/57645
1021 * class.c (deduce_noexcept_on_destructors): Save, set, and restore
1022 TYPE_HAS_NONTRIVIAL_DESTRUCTOR (t) around the main loop over the
1023 destructors.
1024
1025 2013-06-28 Balaji V. Iyer <balaji.v.iyer@intel.com>
1026
1027 * parser.c (cp_parser_array_notation): Removed rejection array notation
1028 of type function pointers. Added handling of array expressions when
1029 Cilk Plus is enabled. Took out type-checking.
1030 (cp_parser_postfix_open_square_expression): Moved normal array expr.
1031 parsing into cp_parser_array_notation when cilkplus is enabled.
1032 (cp_parser_compound_statement): Removed expansion of array notations.
1033 (cp_parser_ctor_initializer_opt_and_function_body): Likewise.
1034 (cp_parser_function_definition_after_declarator): Likewise.
1035 (cp_parser_selection_statement): Removed error reporting.
1036 (cp_parser_iteration_statement): Likewise.
1037 (cp_parser_direct_declarator): Removed error checking/reporting if
1038 array notations are used in the declarator.
1039 * pt.c (instantiate_decl): Likewise.
1040 (type_unification_real): Removed a check for ARRAY_NOTATION_REF.
1041 (cxx_eval_constant_expression): Removed ARRAY_NOTATION_REF case.
1042 (potential_constant_expression_1): Returned false for
1043 ARRAY_NOTATION_REF case.
1044 * cp-gimplify.c (cp_genericize): Added expansion of array notation
1045 expressions here.
1046 * cp-array-notation.c (make_triplet_val_inv): Removed loc and cry
1047 parameters. Replaced build_decls with get_temp_regvar with type as
1048 ptrdiff.
1049 (create_array_refs): Made the type-casting to ptrdiff_type.
1050 (replace_invariant_var): Added a check for void return type before
1051 creating new var. Replaced build_decl and build_min_nt_loc with
1052 get_temp_regvar.
1053 (expand_an_in_modify_expr): Ditto. Replaced body of redundant else
1054 with gcc_unreachable. Removed few unwanted checks. Made induction
1055 variable type as ptrdiff_type. Removed loc and complain arguments
1056 passed into make_triplet_val_inv. Replaced all modify expression's
1057 code from NOP EXPR to INIT EXPR. Replaced all forceful appending
1058 into stmt. list with the non-forceful one. Replaced some integer
1059 conversion and equality-checking to using tree_int_cst_equal.
1060 (expand_sec_reduce_builtin): All changes mentioned in above function
1061 expand_an_in_modify_expr. Made the new variable type of
1062 SEC_REDUCE_ANY/ALL_{NON}ZERO intrinsic functions as bool.
1063 (expand_array_notation_exprs): Removed SWITCH_EXPR case. Moved all
1064 the error reporting from parser to this function. Removed unwanted
1065 statements and checks from SWITCH_STMT, WHILE_STMT, and DO_STMT cases.
1066 (cilkplus_an_triplet_types_ok_p): Removed rejection of array notation
1067 in function pointers.
1068 (cp_expand_cond_array_notations): Added a new if statements to check
1069 if condition has a zero rank. If so, then just return.
1070 (expand_return_expr): Added a check for return expressions with a rank.
1071 Replaced get_tmp_regvar with a create_temporary_var.
1072 (build_array_notation_ref): Simplified and removed unwanted if-stmts.
1073 Moved common code outside if-statements. Moved type-checking from
1074 parser to here.
1075 * semantics.c (finish_return_stmt): Removed a check for return exprs.
1076 with a rank.
1077 * call.c (convert_like_real): Removed a check for array notation
1078 expression in a function.
1079 (build_over_call): Likewise.
1080 (magic_varargs_p): Added a check for builtin array notation function.
1081 Made this function non-static and removed its prototype.
1082 * cp-tree.h (magic_varargs_p): New prototype.
1083 * typeck.c (cp_build_function_call_vec): Removed automatic setting of
1084 nargs to the param->length when builtin reduction function is used.
1085 (convert_arguments): Replaced check for a constant_p function with
1086 margic_varargs_p function call.
1087 (cp_build_binary_op): Removed calling of the function
1088 find_correct_array_notation_type.
1089 (cp_build_addr_expr_1): Removed an unwanted if-statement.
1090 (convert_for_assignment): Removed automatic return of rhs when array
1091 notation builtin function is used.
1092
1093 2013-06-28 Paolo Carlini <paolo.carlini@oracle.com>
1094
1095 PR c++/57682
1096 * parser.c (cp_parser_save_member_function_body): Handle correctly
1097 curly braces in function-try-block mem-initializers.
1098
1099 2013-06-27 Marc Glisse <marc.glisse@inria.fr>
1100
1101 PR c++/57509
1102 * typeck.c (cp_build_vec_perm_expr): New function.
1103 * cp-tree.h: Declare it.
1104 * parser.c (cp_parser_postfix_expression): Call it.
1105 * pt.c (tsubst_copy): Handle VEC_PERM_EXPR.
1106 (tsubst_copy_and_build): Likewise.
1107
1108 2013-06-27 Marc Glisse <marc.glisse@inria.fr>
1109
1110 PR c++/57172
1111 * pt.c (more_specialized_fn): If both arguments are references,
1112 give priority to an lvalue.
1113
1114 2013-06-26 Jason Merrill <jason@redhat.com>
1115
1116 * typeck2.c (store_init_value): Diagnose a non-constant
1117 initializer for in-class static.
1118
1119 PR c++/57408
1120 * semantics.c (add_capture): Set type to error_mark_node after
1121 error.
1122
1123 2013-06-25 Ed Smith-Rowland <3dw4rd@verizon.net>
1124
1125 PR c++/57640
1126 * parser.c (cp_parser_unqualified_id): Add declarator_p to checks
1127 to trigger warning, (cp_literal_operator_id): Remove bogus TODO comment.
1128
1129 2013-06-22 Gabriel Dos Reis <gdr@integrable-solutions.net>
1130
1131 * call.c (null_ptr_cst_p): Use cxx11 in lieu of cxx0x.
1132 * class.c (add_implicitly_declared_members): Likewise.
1133 (check_field_decl): Likewise.
1134 (finalize_literal_type_property): Likewise.
1135 (check_bases_and_members): Likewise.
1136 * decl.c (poplevel): Likewise.
1137 (case_conversion): Likewise.
1138 (check_initializer): Likewise.
1139 (grokfndecl): Likewise.
1140 (check_static_variable_definition): Likewise.
1141 (compute_array_index_type): Likewise.
1142 (grokdeclarator): Likewise.
1143 (build_enumerator): Likewise.
1144 * friend.c (make_friend_class): Likewise.
1145 * lex.c (init_reswords): Likewise.
1146 * method.c (synthesized_method_walk): Likewise.
1147 (implicitly_declare_fn): Likewise.
1148 * parser.c (cp_parser_diagnose_invalid_type_name): Likewise.
1149 (cp_parser_constant_expression): Likewise.
1150 (cp_parser_for_init_statement): Likewise.
1151 (cp_parser_block_declaration): Likewise.
1152 (cp_parser_type_name): Likewise.
1153 (cp_parser_enum_specifier): Likewise.
1154 (cp_parser_enumerator_list): Likewise.
1155 (cp_parser_member_declaration): Likewise.
1156 (cp_nth_tokens_can_be_std_attribute_p): Likewise.
1157 (cp_parser_template_declaration_after_export): Likewise.
1158 * pt.c (convert_nontype_argument_function): Likewise.
1159 (convert_nontype_argument): Likewise.
1160 (convert_template_argument): Likewise.
1161 (tsubst_copy_and_build): Likewise.
1162 (build_non_dependent_expr): Likewise.
1163 * semantics.c (non_const_var_error): Likewise.
1164 (potential_constant_expression_1): Likewise.
1165 * tree.c (lvalue_kind): Likewise.
1166 (build_vec_init_expr): Likewise.
1167 (cast_valid_in_integral_constant_expression_p): Likewise.
1168 * typeck.c (build_x_conditional_expr): Likewise.
1169 * typeck2.c (check_narrowing): Likewise.
1170
1171 2013-06-21 Balaji V. Iyer <balaji.v.iyer@intel.com>
1172
1173 * cp-array-notation.c (cp_length_mismatch_in_expr_p): Remove.
1174 (expand_an_in_modify_expr): Changed a function call from the above
1175 removed function to length_mismatch_in_expr_p.
1176
1177 2013-06-21 Balaji V. Iyer <balaji.v.iyer@intel.com>
1178
1179 * call.c (convert_like_real): Added a check if array notation is present
1180 in expression. If so, then no conversion of arguments is necessary.
1181 (build_over_call): Likewise.
1182 * typeck.c (cp_build_function_call_vec): Likewise.
1183 (convert_for_assignment): Likewise.
1184 (cp_build_array_ref): Reject array notations with a rank greater than 1
1185 as an array's index.
1186 (cp_build_binary_op): If array notations are preent in op, then call
1187 find_correct_array_notation_type.
1188 (cp_build_addr_expr_1): Handle ARRAY_NOTATION_REF similar to ARRAY_REF.
1189 * cp-array-notation.c: New file.
1190 * cp-objcp-common.c (cp_common_init_ts): Marked ARRAY_NOTATION_REF tree
1191 as typed.
1192 * cp-tree.h (fix_array_notation_exprs): New prototype.
1193 * semantics.c (finish_return_stmt): Reject array notations as
1194 return value.
1195 (cxx_eval_constant_expression): Added ARRAY_NOTATION_REF case.
1196 (potential_constant_expression_1): Likewise.
1197 * tree.c (lvalue_kind): Likewise.
1198 * error.c (dump_decl): Likewise.
1199 (dump_expr): Likewise.
1200 * pt.c (ARRAY_NOTATION_REF): Likewise.
1201 (type_unification_real): Do not unify any arguments if array notations
1202 are found in arg.
1203 (instantiate_decl): Added a check for array notaitons inside the
1204 function body. If so, then expand them.
1205 * parser.c (cp_parser_array_notation): New function.
1206 (cp_parser_postfix_open_square_expression): Added a check for colons
1207 inside square braces. If found, then handle the array access as an
1208 array notation access. Also, disable auto-correction from a single
1209 colon to scope when Cilk Plus is enabled.
1210 (cp_parser_compound_statement): Added a check for array notations
1211 inside the statement. If found, then expand them.
1212 (cp_parser_ctor_initializer_opt_and_function_body): Likewise.
1213 (cp_parser_function_definition_after_declarator): Likewise.
1214 (cp_parser_selection_statement): Searched for array notations inside
1215 condition. If so, then emit an error.
1216 (cp_parser_iteration_statement): Likewise.
1217 (cp_parser_direct_declarator): Reject array notations inside a
1218 variable or array declaration.
1219 * Make-lang.in (CXX_AND_OBJCXX_OBJS): Added cp/cp-array-notation.o.
1220
1221 2013-06-20 Jason Merrill <jason@redhat.com>
1222
1223 PR c++/55149
1224 * decl.c (compute_array_index_type): Don't reject VLAs in SFINAE
1225 context if we're in C++14 mode.
1226 * tree.c (array_of_runtime_bound_p): Return true for a dependent
1227 bound that is not potentually constant.
1228 * cp-tree.h (DECL_VLA_CAPTURE_P, REFERENCE_VLA_OK): New.
1229 * pt.c (tsubst) [REFERENCE_TYPE]: Check REFERENCE_VLA_OK.
1230 * semantics.c (build_lambda_object): Don't rvalue a VLA capture.
1231 (build_capture_proxy): Set REFERENCE_VLA_OK.
1232 (vla_capture_type): Make it a proper C++ class.
1233 (add_capture): Set DECL_VLA_CAPTURE_P. Don't pre-digest the
1234 initializer.
1235
1236 * decl.c (compute_array_index_type): Use size_one_node.
1237
1238 * pt.c (process_partial_specialization): Build a TEMPLATE_DECL for
1239 a partial specialization.
1240 (tsubst_decl): Don't clobber CLASSTYPE_TI_TEMPLATE of a partial
1241 specialization.
1242 (most_specialized_class): Adjust.
1243
1244 * cp-tree.h (DECL_TEMPLATE_PARMS, DECL_TEMPLATE_RESULT)
1245 (DECL_TEMPLATE_INSTANTIATIONS, DECL_TEMPLATE_SPECIALIZATIONS): Use
1246 TEMPLATE_DECL_CHECK.
1247
1248 2013-06-19 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1249
1250 PR c++/57638
1251 * pt.c (unify, [TEMPLATE_PARM_INDEX]): Pass to unify_type_mismatch
1252 TREE_TYPE (arg), not arg itself.
1253
1254 2013-06-18 Paolo Carlini <paolo.carlini@oracle.com>
1255
1256 PR c++/53211
1257 * pt.c (type_dependent_expression_p): Handle an array of unknown
1258 bound depending on a variadic parameter.
1259 * parser.c (cp_parser_range_for): Revert PR56794 changes.
1260
1261 2013-06-17 Richard Biener <rguenther@suse.de>
1262
1263 * cp-tree.h (ANON_AGGRNAME_FORMAT, ANON_AGGRNAME_P): Move to tree.h.
1264
1265 2013-06-17 Paolo Carlini <paolo.carlini@oracle.com>
1266
1267 PR c++/16128
1268 * parser.c (cp_parser_expression_statement): Check whether
1269 cp_parser_expression returns error_mark_node.
1270
1271 2013-06-14 Paolo Carlini <paolo.carlini@oracle.com>
1272
1273 PR c++/51413
1274 * semantics.c (finish_offsetof): Handle INDIRECT_REF as expr.
1275
1276 2013-06-14 Paolo Carlini <paolo.carlini@oracle.com>
1277
1278 PR c++/57599
1279 * rtti.c (build_dynamic_cast_1): In case of cast to an unambiguous
1280 accessible base simply forward to build_static_cast.
1281
1282 2013-06-12 Paolo Carlini <paolo.carlini@oracle.com>
1283
1284 PR c++/38958
1285 * decl.c (poplevel): For the benefit of -Wunused-variable see
1286 through references.
1287
1288 2013-06-12 Paolo Carlini <paolo.carlini@oracle.com>
1289
1290 * parser.c (cp_parser_nested_name_specifier_opt): Fix typo in comment.
1291
1292 2013-06-12 Paolo Carlini <paolo.carlini@oracle.com>
1293
1294 PR c++/42021
1295 * parser.c (cp_parser_nested_name_specifier_opt): Avoid emitting
1296 again diagnostic already emitted by cp_parser_lookup_name.
1297
1298 2013-06-11 Jan Hubicka <jh@suse.cz>
1299
1300 PR c++/57551
1301 * cp/pt.c (mark_decl_instantiated): Do not export explicit
1302 instantiations of anonymous namespace templates.
1303
1304 2013-06-10 Jason Merrill <jason@redhat.com>
1305
1306 * name-lookup.c (add_decl_to_level): Add decls in an anonymous
1307 namespace to static_decls.
1308
1309 2013-06-07 Sriraman Tallam <tmsriram@google.com>
1310
1311 PR c++/57548
1312 * call.c (build_over_call): Check if current_function_decl is
1313 NULL.
1314
1315 2013-06-07 Paolo Carlini <paolo.carlini@oracle.com>
1316
1317 PR c++/53658
1318 * pt.c (lookup_template_class_1): Consistently use TYPE_MAIN_DECL,
1319 not TYPE_STUB_DECL, to access the _DECL for a _TYPE.
1320
1321 2013-06-06 Jason Merrill <jason@redhat.com>
1322
1323 PR c++/55520
1324 * semantics.c (add_capture): Diagnose capture of variable-size
1325 type that is not a C++1y array of runtime bound.
1326
1327 * decl.c (grokdeclarator): Keep a decl with error type.
1328 (grokfield, grokbitfield): Likewise.
1329 * pt.c (instantiate_class_template_1): Likewise.
1330 (tsubst_decl): Drop redundant error.
1331 * class.c (walk_subobject_offsets): Handle erroneous fields.
1332 * typeck2.c (process_init_constructor_record): Likewise.
1333
1334 2013-06-05 Paolo Carlini <paolo.carlini@oracle.com>
1335
1336 PR c++/51908
1337 * parser.c (cp_parser_postfix_expression [RID_*CAST]): Set
1338 parser->in_type_id_in_expr_p before calling cp_parser_type_id.
1339
1340 2013-06-03 Jan Hubicka <jh@suse.cz>
1341
1342 * decl2.c (maybe_make_one_only): Use forced_by_abi instead of
1343 mark_decl_referenced.
1344 (mark_needed): Likewise.
1345
1346 2013-06-03 Jason Merrill <jason@redhat.com>
1347
1348 * class.c (mark_type_abi_tags): New.
1349 (check_abi_tags): Use it.
1350
1351 2013-06-03 Paolo Carlini <paolo.carlini@oracle.com>
1352
1353 PR c++/57419
1354 * decl2.c (mark_used): Add overload taking a tsubst_flags_t too.
1355 * semantics.c (finish_qualified_id_expr): Use it.
1356 * cp-tree.h: Update.
1357
1358 2013-06-01 Jan Hubicka <jh@suse.cz>
1359
1360 * decl2.c (cp_write_global_declarations): Replace same_body_alias
1361 by symbol.cpp_implicit_alias.
1362
1363 2013-05-30 Jason Merrill <jason@redhat.com>
1364
1365 PR c++/57404
1366 * cp-lang.c (cp_classify_record): Handle structs without
1367 TYPE_LANG_SPECIFIC.
1368
1369 PR c++/52377
1370 * class.c (common_enclosing_class): New.
1371 * cp-tree.h: Declare it.
1372 * init.c (sort_mem_initializers): Don't splice out a union member
1373 with an NSDMI.
1374
1375 2013-05-29 Jan Hubicka <jh@suse.cz>
1376
1377 * tree.c (cp_fix_function_decl_p): Update for new symtab flags.
1378 * decl2.c )var_finalized_p, cp_write_global_declarations): Likewise.
1379
1380 2013-05-25 Paolo Carlini <paolo.carlini@oracle.com>
1381
1382 PR c++/25666
1383 * decl2.c (check_classfn): Check for destructors declared as member
1384 templates.
1385
1386 2013-05-24 Jason Merrill <jason@redhat.com>
1387
1388 PR c++/56971
1389 * pt.c (any_template_arguments_need_structural_equality_p): A
1390 TEMPLATE_TEMPLATE_PARM can require structural type comparison.
1391
1392 2013-05-24 Paolo Carlini <paolo.carlini@oracle.com>
1393
1394 PR c++/19618
1395 * class.c (check_bitfield_decl): Warn for bool and enum bitfields
1396 with width exceeding the type.
1397
1398 2013-05-24 Jason Merrill <jason@redhat.com>
1399
1400 PR c++/57391
1401 * semantics.c (cxx_eval_constant_expression): Handle FMA_EXPR.
1402 (cxx_eval_trinary_expression): Rename from cxx_eval_vec_perm_expr.
1403
1404 2013-05-23 Jason Merrill <jason@redhat.com>
1405
1406 PR c++/57388
1407 * tree.c (build_ref_qualified_type): Clear
1408 FUNCTION_RVALUE_QUALIFIED for lvalue ref-qualifier.
1409
1410 2013-05-22 Jason Merrill <jason@redhat.com>
1411
1412 PR c++/56930
1413 * call.c (convert_like_real): Use cp_convert_and_check.
1414 * cvt.c (cp_convert_and_check): Use maybe_constant_value.
1415 * semantics.c (cxx_eval_constant_expression): Handle LTGT_EXPR.
1416 (potential_constant_expression_1): Handle OMP_ATOMIC*.
1417
1418 PR c++/56915
1419 * semantics.c (maybe_add_lambda_conv_op): Give up if the call op
1420 isn't defined.
1421
1422 2013-05-22 Paolo Carlini <paolo.carlini@oracle.com>
1423
1424 PR c++/57352
1425 * parser.c (cp_parser_conversion_type_id): Set up
1426 parser->type_definition_forbidden_message before calling
1427 cp_parser_type_specifier_seq.
1428
1429 2013-05-22 Paolo Carlini <paolo.carlini@oracle.com>
1430
1431 PR c++/57211
1432 * method.c (defaultable_fn_check): Avoid do_warn_unused_parameter
1433 warnings about defaulted functions.
1434
1435 2013-05-21 Paolo Carlini <paolo.carlini@oracle.com>
1436
1437 * call.c (build_conditional_expr_1): Add location_t parameter.
1438 (build_conditional_expr): Likewise.
1439 * typeck.c (rationalize_conditional_expr, cp_build_array_ref,
1440 get_member_function_from_ptrfunc, build_x_conditional_expr,
1441 cp_build_modify_expr): Update.
1442 * init.c (build_new_1): Likewise.
1443 * cp-tree.h: Update declaration.
1444
1445 2013-05-20 Jason Merrill <jason@redhat.com>
1446
1447 PR c++/57016
1448 * pt.c (instantiation_dependent_r) [TRAIT_EXPR]: Only check type2
1449 if there is one.
1450
1451 PR c++/57102
1452 * decl.c (fndecl_declared_return_type): Also look in
1453 DECL_SAVED_FUNCTION_DATA.
1454
1455 2013-05-20 Paolo Carlini <paolo.carlini@oracle.com>
1456
1457 PR c++/12288
1458 * parser.c (cp_parser_parameter_declaration): Check return value
1459 of cp_parser_parse_and_diagnose_invalid_type_name.
1460
1461 2013-05-20 Jason Merrill <jason@redhat.com>
1462
1463 PR c++/57319
1464 * class.c (vbase_has_user_provided_move_assign): New.
1465 * method.c (synthesized_method_walk): Check it.
1466 * cp-tree.h: Declare it.
1467
1468 PR c++/57325
1469 * tree.c (build_cplus_array_type): Copy layout info if element
1470 type is complete.
1471
1472 2013-05-20 Paolo Carlini <paolo.carlini@oracle.com>
1473
1474 PR c++/23608
1475 * call.c (build_new_op_1): Propagate loc to cp_build_binary_op.
1476
1477 2013-05-20 Jason Merrill <jason@redhat.com>
1478
1479 PR c++/57317
1480 * decl2.c (determine_visibility): Use PRIMARY_TEMPLATE_P to decide
1481 whether a template has its own args.
1482
1483 2013-05-20 Paolo Carlini <paolo.carlini@oracle.com>
1484
1485 PR c++/57327
1486 * pt.c (unify_no_common_base): Swap arg and parm arguments to inform.
1487
1488 2013-05-20 Paolo Carlini <paolo.carlini@oracle.com>
1489
1490 PR c++/10207
1491 * parser.c (cp_parser_postfix_expression): Use cp_parser_braced_list
1492 instead of cp_parser_initializer_list for compound-literals.
1493
1494 2013-05-20 Marc Glisse <marc.glisse@inria.fr>
1495
1496 PR c++/57175
1497 * typeck.c (check_return_expr): Reverse the alignment comparison.
1498
1499 2013-05-17 Paolo Carlini <paolo.carlini@oracle.com>
1500
1501 PR c++/18126
1502 * parser.c (cp_parser_sizeof_operand): As a GNU Extension, parse
1503 correctly sizeof compound-literal; update comments.
1504
1505 2013-05-16 Marc Glisse <marc.glisse@inria.fr>
1506
1507 * call.c (build_conditional_expr_1): Use cp_build_binary_op
1508 instead of directly calling fold_build2.
1509
1510 2013-05-16 Jason Merrill <jason@redhat.com>
1511
1512 * Make-lang.in (cc1plus$(exeext)): Use link mutex.
1513
1514 PR c++/57279
1515 * decl.c (grokdeclarator): Allow member function qualifiers in
1516 TYPENAME context in C++11 mode.
1517
1518 2013-05-16 Dodji Seketeli <dodji@redhat.com>
1519
1520 PR c++/56782 - Regression with empty pack expansions
1521 * pt.c (use_pack_expansion_extra_args_p): When at least a
1522 parameter pack has an empty argument pack, and another parameter
1523 pack has no argument pack at all, use the PACK_EXPANSION_EXTRA
1524 mechanism.
1525
1526 2013-05-15 Paolo Carlini <paolo.carlini@oracle.com>
1527
1528 * name-lookup.c (pushdecl_maybe_friend_1): Replace pairs of
1529 warning_at and permerror with warning_at/inform and permerror/
1530 inform, respectively.
1531
1532 2013-05-15 Paolo Carlini <paolo.carlini@oracle.com>
1533
1534 PR c++/31952
1535 * name-lookup.c (pushdecl_maybe_friend_1): Diagnose illegal
1536 redeclarations.
1537
1538 2013-05-14 Jason Merrill <jason@redhat.com>
1539
1540 PR c++/57243
1541 * parser.c (cp_parser_range_for): Call complete_type.
1542
1543 PR c++/57041
1544 * pt.c (tsubst_copy_and_build): Don't recur into a designator.
1545
1546 2013-05-14 Paolo Carlini <paolo.carlini@oracle.com>
1547
1548 PR c++/53903
1549 * method.c (defaulted_late_check): Check for compatible exception
1550 specification out of class explicitly defaulted functions too.
1551
1552 2013-05-14 Jason Merrill <jason@redhat.com>
1553
1554 PR c++/56998
1555 * semantics.c (potential_constant_expression_1): Make sure the
1556 called function is potentially constant.
1557 * call.c (null_ptr_cst_p): Revert earlier change.
1558
1559 2013-05-13 Jason Merrill <jason@redhat.com>
1560
1561 PR c++/56998
1562 * call.c (null_ptr_cst_p): An expression with side-effects can't
1563 be a C++03 null pointer constant.
1564
1565 PR c++/57041
1566 * decl.c (reshape_init_class): Handle error_mark_node.
1567
1568 PR c++/57254
1569 * typeck.c (merge_types): Propagate ref-qualifier
1570 in METHOD_TYPE case.
1571
1572 PR c++/57253
1573 * decl.c (grokdeclarator): Apply ref-qualifier
1574 in the TYPENAME case.
1575
1576 PR c++/57252
1577 * decl.c (decls_match): Compare ref-qualifiers.
1578
1579 2013-05-10 Jason Merrill <jason@redhat.com>
1580
1581 PR c++/57196
1582 * pt.c (convert_template_argument): Use dependent_template_arg_p,
1583 not uses_template_parms.
1584
1585 PR c++/57047
1586 * semantics.c (cxx_fold_indirect_ref): Fix thinko.
1587
1588 PR c++/55149
1589 * semantics.c (add_capture): Error rather than abort on copy
1590 capture of VLA.
1591 * typeck.c (maybe_warn_about_returning_address_of_local): Don't
1592 warn about capture proxy.
1593
1594 2013-05-09 Jason Merrill <jason@redhat.com>
1595
1596 * decl.c (cp_finish_decl): Only check VLA bound in C++1y mode.
1597
1598 PR c++/57222
1599 * pt.c (lookup_template_class_1): Handle getting a template
1600 template parameter as D1.
1601
1602 N3639 C++1y VLA diagnostics
1603 * decl.c (grokdeclarator): Complain about reference, pointer, or
1604 typedef to VLA.
1605 (create_array_type_for_decl): Complain about array of VLA.
1606 * pt.c (tsubst): Likewise.
1607 * rtti.c (get_tinfo_decl): Talk about "array of runtime bound".
1608 * semantics.c (finish_decltype_type): Complain about decltype of VLA.
1609 * typeck.c (cp_build_addr_expr_1): Complain about VLA.
1610 (cxx_sizeof_or_alignof_type): Likewise.
1611
1612 N3639 C++1y VLA support
1613 * decl.c (compute_array_index_type): Allow VLAs in C++1y mode.
1614 (check_array_initializer): Allow VLA init.
1615 (reshape_init_array_1): Adjust.
1616 (cp_finish_decl): Check for invalid VLA length.
1617 * typeck2.c (process_init_constructor_array): Adjust.
1618 (store_init_value): Use build_vec_init for VLAs.
1619 * semantics.c (add_capture): Capture VLA as ptr+len.
1620 (vla_capture_type): New.
1621 (build_capture_proxy): Rebuild the VLA.
1622 * typeck.c (build_simple_component_ref): Split out from...
1623 (build_ptrmemfunc_access_expr): ...here.
1624 * tree.c (array_of_runtime_bound_p): New.
1625 * init.c (throw_bad_array_length): New.
1626 (build_vec_init): Use it.
1627 * parser.c (cp_convert_range_for): When iterating over a VLA,
1628 use it directly rather than bind a reference.
1629 * cp-tree.h: Declare new functions.
1630
1631 2013-05-08 Jason Merrill <jason@redhat.com>
1632
1633 * except.c (is_admissible_throw_operand_or_catch_parameter): Check
1634 variably_modified_type_p.
1635 (expand_start_catch_block): Mark the typeinfo used here.
1636 * semantics.c (finish_handler_parms): Not here.
1637
1638 * error.c (dump_type_suffix): Try harder on VLA length.
1639
1640 Core 624/N2932
1641 * init.c (throw_bad_array_new_length): New.
1642 (build_new_1): Use it. Don't warn about braced-init-list.
1643 (build_vec_init): Use it.
1644 * call.c (build_operator_new_call): Use it.
1645
1646 PR c++/57068
1647 * decl.c (grokdeclarator): Warn about ref-qualifiers here.
1648 * parser.c (cp_parser_ref_qualifier_seq_opt): Not here.
1649 * error.c (maybe_warn_cpp0x): s/0x/11/.
1650
1651 2013-05-08 Paolo Carlini <paolo.carlini@oracle.com>
1652
1653 PR c++/51226
1654 * parser.c (cp_parser_enum_specifier): Handle nested_name_specifier
1655 == error_mark_node.
1656
1657 2013-05-06 Marc Glisse <marc.glisse@inria.fr>
1658
1659 * typeck.c (cp_build_binary_op): Call save_expr before
1660 build_vector_from_val.
1661
1662 2013-05-06 Paolo Carlini <paolo.carlini@oracle.com>
1663
1664 PR c++/57183
1665 * decl.c (cp_finish_decl): After do_auto_deduction copy the
1666 qualifers with cp_apply_type_quals_to_decl.
1667
1668 2013-05-05 Paolo Carlini <paolo.carlini@oracle.com>
1669
1670 * pt.c (convert_nontype_argument): Add missing whitespace in
1671 error message.
1672
1673 2013-05-04 Paolo Carlini <paolo.carlini@oracle.com>
1674
1675 PR c++/53745
1676 * decl.c (build_enumerator): Improve error message.
1677
1678 2013-05-03 Paolo Carlini <paolo.carlini@oracle.com>
1679
1680 PR c++/14283
1681 * parser.c (cp_parser_diagnose_invalid_type_name): Improve error
1682 messages for template types and fix column numbers.
1683
1684 2013-05-01 Paolo Carlini <paolo.carlini@oracle.com>
1685
1686 PR c++/57132
1687 * pt.c (tsubst_copy_and_build, MODOP_EXPR): Increase / decrease
1688 c_inhibit_evaluation_warnings around build_x_modify_expr call.
1689
1690 2013-05-01 Paolo Carlini <paolo.carlini@oracle.com>
1691
1692 PR c++/57092
1693 * semantics.c (finish_decltype_type): Handle instantiated template
1694 non-type arguments.
1695
1696 2013-04-28 Paolo Carlini <paolo.carlini@oracle.com>
1697
1698 PR c++/56450
1699 * semantics.c (finish_decltype_type): Handle COMPOUND_EXPR.
1700
1701 2013-04-26 Jakub Jelinek <jakub@redhat.com>
1702
1703 * error.c (cp_print_error_function): Adjust file_name_as_prefix
1704 caller.
1705
1706 2013-04-25 Jason Merrill <jason@redhat.com>
1707
1708 PR c++/56859
1709 * typeck.c (cxx_alignas_expr): Handle value-dependence properly.
1710
1711 PR c++/50261
1712 * init.c (perform_member_init): Call reshape_init.
1713
1714 2013-04-24 Jason Merrill <jason@redhat.com>
1715
1716 PR c++/53721
1717 * parser.c (cp_parser_postfix_dot_deref_expression): Fix thinko.
1718
1719 2013-04-24 Paolo Carlini <paolo.carlini@oracle.com>
1720
1721 * typeck.c (cxx_sizeof_or_alignof_type): Change -Wpointer-arith
1722 pedwarn to simply use OPT_Wpointer_arith.
1723 (cp_build_unary_op): Likewise.
1724
1725 2013-04-24 Jason Merrill <jason@redhat.com>
1726
1727 N3648: init-captures are named.
1728 * semantics.c (add_capture): Don't prepend "__" to init-captures.
1729 (build_capture_proxy): Adjust.
1730 * error.c (dump_simple_decl): Check DECL_NORMAL_CAPTURE_P.
1731
1732 N3648: Allow braced and parenthesized initializers.
1733 * parser.c (cp_parser_lambda_introducer): Use cp_parser_initializer.
1734 * pt.c (tsubst) [DECLTYPE_TYPE]: Handle DECLTYPE_FOR_INIT_CAPTURE.
1735 * semantics.c (lambda_capture_field_type): Use do_auto_deduction.
1736 (add_capture): Collapse a parenthesized initializer into a single
1737 expression.
1738 * cp-tree.h (DECLTYPE_FOR_INIT_CAPTURE): New.
1739
1740 2013-04-24 Paolo Carlini <paolo.carlini@oracle.com>
1741
1742 PR c++/56970
1743 * init.c (build_offset_ref): Add tsubst_flags_t parameter.
1744 * semantics.c (finish_qualified_id_expr): Likewise.
1745 (finish_id_expression): Update.
1746 * typeck.c (cp_build_addr_expr_1): Likewise.
1747 * pt.c (tsubst_qualified_id, resolve_nondeduced_context): Likewise.
1748 * cp-tree.h: Update declarations.
1749
1750 2013-04-22 Jason Merrill <jason@redhat.com>
1751
1752 Core 1586
1753 * parser.c (cp_parser_unqualified_id): Handle ~auto.
1754 (cp_parser_pseudo_destructor_name): Likewise.
1755 (cp_parser_postfix_dot_deref_expression): Adjust.
1756 (cp_lexer_nth_token_is_keyword): New.
1757 * semantics.c (finish_pseudo_destructor_expr): Handle ~auto.
1758 * typeck.c (lookup_destructor): Handle ~auto.
1759
1760 * pt.c (fn_type_unification): Push tinst level around
1761 type_unification_real if we aren't explaining.
1762 * cp-tree.h (TFF_NO_TEMPLATE_BINDINGS): New.
1763 * error.c (dump_function_decl): Respect it.
1764 (subst_to_string): Pass it.
1765
1766 PR c++/48665
1767 * rtti.c (get_typeid): Diagnose qualified function type.
1768 * pt.c (tsubst) [POINTER_TYPE]: Likewise.
1769
1770 * error.c (dump_aggr_type): Fix lambda detection.
1771 (dump_simple_decl): Pretty-print capture field.
1772
1773 N3323
1774 * cvt.c (build_expr_type_conversion): Two conversions that return
1775 the same type aren't necessarily ambiguous.
1776
1777 N3648
1778 * parser.c (cp_parser_lambda_introducer): Make lambda capture init
1779 pedwarn unconditional except in C++1y mode.
1780
1781 * semantics.c (potential_constant_expression_1): Don't crash on
1782 'this' in NSDMI.
1783
1784 Core 1612
1785 * semantics.c (finish_id_expression): Reject capture of anonymous
1786 union member.
1787
1788 Core 1609
1789 * decl2.c (check_default_args): Check for pack expansion.
1790
1791 * mangle.c (write_type): Mangle decltype(auto).
1792
1793 2013-04-19 Jason Merrill <jason@redhat.com>
1794
1795 N3638 changes to return type deduction
1796 * decl.c (undeduced_auto_decl): New.
1797 (require_deduced_type): New.
1798 (fndecl_declared_return_type): New.
1799 (decls_match): Use it.
1800 (duplicate_decls): Don't check for auto return.
1801 (grokdeclarator): Reject virtual auto.
1802 * class.c (resolve_address_of_overloaded_function): Handle
1803 auto function templates.
1804 * decl2.c (mark_used): Use undeduced_auto_decl, require_deduced_type.
1805 * cp-tree.h: Declare new fns.
1806 * error.c (dump_function_decl): Use fndecl_declared_return_type.
1807 * search.c (check_final_overrider): Likewise.
1808 * pt.c (make_decltype_auto): New.
1809 (do_auto_deduction): Require plain decltype(auto).
1810 (is_auto): Adjust.
1811
1812 DR 941
1813 * decl.c (duplicate_decls): Don't propagate DECL_DELETED_FN to
1814 template specializations.
1815
1816 2013-04-16 Ed Smith-Rowland <3dw4rd@verizon.net>
1817
1818 Implement n3599 - Literal operator templates for strings.
1819 * parser.c (make_string_pack (tree value)): New function.
1820 (cp_parser_userdef_string_literal (cp_token *)): Use it
1821 to construct calls to character string literal operator templates.
1822 (cp_parser_template_declaration_after_export): Check for new string
1823 literal operator template parameter form.
1824
1825 2013-04-15 Jason Merrill <jason@redhat.com>
1826
1827 * pt.c (tsubst) [DECLTYPE_TYPE]: Use tsubst_copy_and_build.
1828
1829 PR c++/52748
1830 * pt.c (tsubst) [DECLTYPE_TYPE]: If ~id is an expression
1831 rather than a destructor name, it isn't an unqualified-name.
1832 (tsubst_copy_and_build): Pass down decltype_flag to operator
1833 handling code, too.
1834
1835 PR c++/56388
1836 * semantics.c (insert_capture_proxy): Just use index 1 in the
1837 stmt_list_stack.
1838
1839 2013-04-12 Jakub Jelinek <jakub@redhat.com>
1840
1841 * error.c (cp_print_error_function,
1842 print_instantiation_partial_context_line,
1843 maybe_print_constexpr_context): Colorize locus strings.
1844
1845 2013-04-11 Jason Merrill <jason@redhat.com>
1846
1847 PR c++/52748
1848 * parser.c (complain_flags): New.
1849 (cp_parser_postfix_expression): Use it.
1850 (cp_parser_unary_expression): Likewise.
1851 (cp_parser_binary_expression): Likewise.
1852 (cp_parser_assignment_expression): Likewise.
1853 (cp_parser_expression): Likewise.
1854 (cp_parser_postfix_open_square_expression): Take decltype_p.
1855 (cp_parser_builtin_offsetof): Adjust.
1856 (cp_convert_range_for): Pass complain to finish_unary_op_expr.
1857 * decl2.c (grok_array_decl): Add decltype_p parm.
1858 * cp-tree.h: Adjust prototype.
1859 * semantics.c (finish_unary_op_expr): Add complain parm.
1860
1861 2013-04-11 Jakub Jelinek <jakub@redhat.com>
1862
1863 PR c++/56895
1864 * call.c (null_ptr_cst_p): Call fold_non_dependent_expr_sfinae before
1865 calling maybe_constant_value for C++98.
1866
1867 2013-04-11 Jason Merrill <jason@redhat.com>
1868
1869 PR c++/56901
1870 * semantics.c (lambda_capture_field_type, lambda_proxy_type):
1871 Strip references before checking WILDCARD_TYPE_P.
1872
1873 2013-04-11 Paolo Carlini <paolo.carlini@oracle.com>
1874
1875 * call.c (build_conditional_expr_1, build_over_call): Protect
1876 error calls with complain & tf_error.
1877 * typeck.c (finish_class_member_access_expr, cp_build_binary_op,
1878 build_x_unary_op, cp_build_unary_op, cp_build_compound_expr,
1879 build_ptrmemfunc): Likewise.
1880 (lookup_destructor): Take tsubst_flags_t parameter, adjust.
1881
1882 * cvt.c (warn_ref_binding): Rename to diagnose_ref_binding.
1883 (convert_to_reference): Adjust.
1884
1885 2013-04-11 Jason Merrill <jason@redhat.com>
1886
1887 * pt.c (tsubst_copy) [VAR_DECL]: Don't call tsubst for
1888 local variables, look them up instead.
1889 (tsubst_decl) [VAR_DECL]: Remove handling for anonymous union
1890 proxies and substitution in unevaluated context.
1891 (tsubst_expr) [OMP_FOR]: Instantiate OMP_FOR_PRE_BODY
1892 before the iterators.
1893
1894 PR c++/23055
1895 * pt.c (uses_deducible_template_parms): New.
1896 (deducible_array_bound, deducible_expression): New.
1897 (deducible_template_args): New.
1898 (unify_one_argument): Call uses_deducible_template_parms.
1899
1900 2013-04-11 Paolo Carlini <paolo.carlini@oracle.com>
1901
1902 PR c++/56913
1903 * typeck2.c (build_m_component_ref): Protect error calls with
1904 (complain & tf_error).
1905
1906 2013-04-11 Paolo Carlini <paolo.carlini@oracle.com>
1907
1908 PR c++/54216
1909 * parser.c (cp_parser_enum_specifier): Check for empty
1910 anonymous enums and anonymous scoped enums.
1911
1912 2013-04-10 Jakub Jelinek <jakub@redhat.com>
1913
1914 PR c++/56895
1915 * typeck.c (cp_build_binary_op): Call fold_non_dependent_expr_sfinae
1916 first before calling maybe_constant_value for warn_for_div_by_zero
1917 or invalid shift count warning purposes.
1918
1919 2013-04-09 Jason Merrill <jason@redhat.com>
1920
1921 PR c++/25466
1922 * rtti.c (build_typeid): Check the address of the argument
1923 rather than looking for an INDIRECT_REF.
1924
1925 2013-04-04 Jason Merrill <jason@redhat.com>
1926
1927 PR c++/56838
1928 PR c++/17232
1929 * typeck2.c (abstract_virtuals_error_sfinae): Disable
1930 complete_type again.
1931
1932 2013-04-08 Paolo Carlini <paolo.carlini@oracle.com>
1933
1934 PR c++/56871
1935 * decl.c (validate_constexpr_redeclaration): Allow an explicit
1936 specialization to be different wrt the constexpr specifier.
1937
1938 2013-04-06 Jason Merrill <jason@redhat.com>
1939
1940 * parser.c (cp_parser_std_attribute): Treat [[noreturn]] like GNU
1941 noreturn attribute.
1942
1943 2013-04-05 Ed Smith-Rowland <3dw4rd@verizon.net>
1944
1945 * parser.c (cp_parser_ref_qualifier_seq_opt): Move to
1946 cp_parser_ref_qualifier_opt. Error if more than one ref-qual found.
1947
1948 2013-04-03 Jason Merrill <jason@redhat.com>
1949
1950 * cp-tree.h (FUNCTION_OR_METHOD_TYPE_CHECK): Remove.
1951 (TYPE_RAISES_EXCEPTIONS): Use FUNC_OR_METHOD_CHECK instead.
1952 (FUNCTION_REF_QUALIFIED, FUNCTION_RVALUE_QUALIFIED): Likewise.
1953
1954 * mangle.c (write_type): When writing a function type with
1955 function-cv-quals, don't add the unqualified type as a
1956 substitution candidate.
1957
1958 2013-04-03 Paolo Carlini <paolo.carlini@oracle.com>
1959
1960 PR c++/56815
1961 * typeck.c (cp_build_unary_op): Change -Wpointer-arith permerror to
1962 pedwarn.
1963
1964 2013-04-03 Jakub Jelinek <jakub@redhat.com>
1965
1966 PR debug/56819
1967 * tree.c (strip_typedefs): Copy NON_DEFAULT_TEMPLATE_ARGS_COUNT
1968 from args to new_args.
1969 (strip_typedefs_expr): Copy NON_DEFAULT_TEMPLATE_ARGS_COUNT from t to
1970 r instead of doing {S,G}ET_NON_DEFAULT_TEMPLATE_ARGS_COUNT.
1971
1972 2013-04-02 Jason Merrill <jason@redhat.com>
1973
1974 PR c++/56821
1975 * mangle.c (write_function_type): Mangle ref-qualifier.
1976 (write_nested_name): Likewise.
1977 (canonicalize_for_substitution): Preserve ref-qualifier.
1978 (write_type): Likewise.
1979
1980 PR c++/34949
1981 * decl.c (begin_destructor_body): Clobber the object in a cleanup.
1982
1983 2013-04-02 Paolo Carlini <paolo.carlini@oracle.com>
1984
1985 * friend.c (do_friend): Use COMPLETE_OR_OPEN_TYPE_P.
1986 * pt.c (find_parameter_packs_r): Use TYPE_ALIAS_P and TYPE_TI_ARGS.
1987 (for_each_template_parm_r): Use TYPE_TI_ARGS.
1988
1989 2013-04-02 Paolo Carlini <paolo.carlini@oracle.com>
1990
1991 * cp-tree.h (TAGGED_TYPE_P): Remove.
1992 (IS_OVERLOAD_TYPE): Rename to OVERLOAD_TYPE_P, adjust.
1993 (TYPE_ANONYMOUS_P): Adjust.
1994 * call.c (build_new_op_1): Likewise.
1995 * class.c (find_abi_tags_r): Likewise.
1996 * decl.c (warn_misplaced_attr_for_class_type, start_decl,
1997 type_is_deprecated): Likewise.
1998 * decl2.c (grokfield, min_vis_r): Likewise.
1999 * pt.c (get_template_info): Likewise.
2000 * tree.c (handle_abi_tag_attribute): Likewise.
2001
2002 2013-04-01 Jason Merrill <jason@redhat.com>
2003
2004 * semantics.c (maybe_constant_value): Check
2005 instantiation_dependent_expression_p.
2006 * pt.c (build_non_dependent_expr): Don't check it here.
2007
2008 PR c++/56772
2009 * init.c (build_new): Don't try to process an array initializer
2010 at template definition time.
2011
2012 PR c++/56793
2013 * typeck.c (finish_class_member_access_expr): Handle enum scope.
2014
2015 PR c++/56794
2016 * parser.c (cp_parser_range_for): Don't try to do auto deduction
2017 in a template if the type of the range is incomplete.
2018
2019 * call.c (add_function_candidate): Take the address of 'this' here.
2020 (build_over_call): And here.
2021 (build_new_method_call_1, build_op_call_1): Not here.
2022 (build_user_type_conversion_1): Or here.
2023 (add_candidates): Adjust.
2024
2025 * cxx-pretty-print.h (pp_cxx_cv_qualifiers): New.
2026 * class.c (same_signature_p): Use type_memfn_quals.
2027 * cp-tree.h (TYPE_RAISES_EXCEPTIONS): Use
2028 FUNCTION_OR_METHOD_TYPE_CHECK.
2029 * error.c (dump_type_suffix): Add padding before cv-qualifiers.
2030 * pt.c (unify): Use static_fn_type.
2031
2032 2013-04-01 Bronek Kozicki <b.kozicki@gmail.com>
2033 Jason Merrill <jason@redhat.com>
2034
2035 Implement N2439 (ref-qualifiers for 'this')
2036 * cp-tree.h (FUNCTION_REF_QUALIFIED): New.
2037 (FUNCTION_RVALUE_QUALIFIED): New.
2038 (FUNCTION_OR_METHOD_TYPE_CHECK): New.
2039 (cpp0x_warn_str): Add CPP0X_REF_QUALIFIER.
2040 (cp_ref_qualifier): New enum.
2041 (cp_declarator): Add ref_qualifier.
2042 * parser.c (cp_parser_ref_qualifier_seq_opt): New.
2043 (cp_parser_direct_declarator): Use it.
2044 (make_call_declarator): Adjust.
2045 (cp_parser_lambda_declarator_opt): Adjust.
2046 * call.c (add_function_candidate): Handle ref-qualifier overload
2047 resolution semantics.
2048 (standard_conversion): Adjust.
2049 * class.c (add_method, same_signature_p): Compare ref-qualifiers.
2050 * decl.c (grokdeclarator): Handle ref-qualifiers.
2051 (grokfndecl): Check for invalid ref-qualifiers.
2052 (static_fn_type, revert_static_member_fn): Adjust.
2053 * decl2.c (build_memfn_type): Handle ref-qualifiers.
2054 (check_classfn): Check them.
2055 (cp_reconstruct_complex_type): Retain them.
2056 * error.c (dump_ref_qualifier): New.
2057 (dump_type_suffix, dump_function_decl): Use it.
2058 (maybe_warn_cpp0x): Handle CPP0X_REF_QUALIFIER.
2059 * pt.c (tsubst, tsubst_function_type): Instantiate ref-quals.
2060 (unify): Retain them.
2061 * tree.c (cp_check_qualified_type): New.
2062 (cp_build_qualified_type_real): Keep exception spec and ref-qual.
2063 (build_ref_qualified_type): New.
2064 (strip_typedefs, build_exception_variant): Keep ref-qualifier.
2065 (cp_build_type_attribute_variant): Keep ref-qualifier.
2066 * typeck.c (merge_types): Keep ref-qualifier.
2067 (structural_comptypes): Compare ref-qualifier.
2068 (type_memfn_rqual): New.
2069 (apply_memfn_quals): Take ref-qual argument.
2070 * typeck2.c (build_m_component_ref): Check ref-qualifier.
2071
2072 2013-04-01 Paolo Carlini <paolo.carlini@oracle.com>
2073
2074 * cp-tree.h (DECL_UNBOUND_CLASS_TEMPLATE_P): Remove.
2075 (DECL_FUNCTION_TEMPLATE_P): Adjust.
2076
2077 * cxx-pretty-print.c (pp_cxx_nested_name_specifier,
2078 pp_cxx_qualified_id): Use get_containing_scope.
2079 * parser.c (cp_parser_class_head): Likewise.
2080 * pt.c (push_template_decl_real): Likewise.
2081
2082 * decl2.c (import_export_decl): Use DECL_TEMPLOID_INSTANTIATION.
2083 * pt.c (unify): Use CP_INTEGRAL_TYPE_P.
2084
2085 2013-03-31 Paolo Carlini <paolo.carlini@oracle.com>
2086
2087 * decl2.c (collect_candidates_for_java_method_aliases): Use
2088 DECL_CLASS_SCOPE_P.
2089 * name-lookup.c (pushtag_1) Use TYPE_FUNCTION_SCOPE_P.
2090 (pushdecl_maybe_friend_1): Use DECL_DECLARES_FUNCTION_P.
2091 * decl.c (duplicate_decls): Likewise.
2092 * parser.c (cp_parser_template_declaration_after_export): Likewise,
2093 also DECL_DECLARES_TYPE_P.
2094 * pt.c (instantiate_class_template_1): Likewise.
2095 * search.c (lookup_field_1): Use DECL_DECLARES_TYPE_P.
2096 (lookup_field_r): Likewise.
2097 (friend_accessible_p): Use DECL_DECLARES_FUNCTION_P.
2098 (lookup_fnfields_slot_nolazy): Likewise.
2099 * semantics.c (finish_member_declaration): Likewise.
2100 * typeck.c (convert_for_initialization): Use TYPE_REFFN_P.
2101
2102 2013-03-29 Gabriel Dos Reis <gdr@integrable-solutions.net>
2103
2104 * pt.c (template_parms_to_args): Fix typo in comment.
2105
2106 2013-03-29 Paolo Carlini <paolo.carlini@oracle.com>
2107
2108 * call.c (build_op_call_1): Use TYPE_PTRFN_P and TYPE_REFFN_P.
2109
2110 2013-03-29 Paolo Carlini <paolo.carlini@oracle.com>
2111
2112 * call.c (add_builtin_candidate): Use TYPE_PTR_P and VOID_TYPE_P.
2113 (build_op_call_1): Likewise.
2114 (build_over_call): Likewise.
2115 (compare_ics): Likewise.
2116 * class.c (build_base_path): Likewise.
2117 (resolve_address_of_overloaded_function): Likewise.
2118 * cp-tree.h: Likewise.
2119 * cvt.c (cp_convert_to_pointer): Likewise.
2120 (convert_to_reference): Likewise.
2121 (ocp_convert): Likewise.
2122 (convert_force): Likewise, tidy.
2123 * cxx-pretty-print.c (pp_cxx_postfix_expression): Likewise.
2124 (pp_cxx_ptr_operator): Likewise.
2125 * decl.c (duplicate_decls): Likewise.
2126 (start_decl): Likewise.
2127 (grok_op_properties): Likewise.
2128 (start_preparsed_function): Likewise.
2129 (store_parm_decls): Likewise.
2130 (finish_function): Likewise.
2131 * decl2.c (delete_sanity): Likewise.
2132 (acceptable_java_type): Likewise.
2133 (grokbitfield): Likewise.
2134 (cp_reconstruct_complex_type): Likewise.
2135 * error.c (dump_type_prefix): Likewise.
2136 (dump_expr): Likewise.
2137 * except.c (push_eh_cleanup): Likewise.
2138 (complete_ptr_ref_or_void_ptr_p): Likewise.
2139 (can_convert_eh): Likewise.
2140 * init.c (build_new_1): Likewise.
2141 (build_delete): Likewise.
2142 (build_vec_delete): Likewise.
2143 * mangle.c (write_type): Likewise.
2144 * parser.c (lookup_literal_operator): Likewise.
2145 * pt.c (convert_nontype_argument_function): Likewise.
2146 (convert_nontype_argument): Likewise.
2147 (tsubst): Likewise.
2148 (unify): Likewise.
2149 (dependent_type_p_r): Likewise.
2150 * rtti.c (build_headof): Likewise.
2151 (build_typeid): Likewise.
2152 (build_dynamic_cast_1): Likewise.
2153 (target_incomplete_p): Likewise.
2154 (typeinfo_in_lib_p): Likewise.
2155 * semantics.c (finish_omp_for): Likewise.
2156 (cxx_eval_call_expression): Likewise.
2157 (maybe_resolve_dummy): Likewise.
2158 * tree.c (build_target_expr): Likewise.
2159 (cp_build_qualified_type_real): Likewise.
2160 * typeck.c (composite_pointer_type_r): Likewise.
2161 (composite_pointer_type): Likewise.
2162 (comp_except_types): Likewise.
2163 (cxx_sizeof_nowarn): Likewise.
2164 (string_conv_p): Likewise.
2165 (cp_build_array_ref): Likewise.
2166 (cp_build_function_call_vec): Likewise, also use TYPE_PTRFN_P.
2167 (pointer_diff): Likewise.
2168 (cp_build_addr_expr_1): Likewise.
2169 (cp_build_unary_op): Likewise.
2170 (build_static_cast_1): Likewise.
2171 (cp_build_c_cast): Likewise.
2172 (comp_ptr_ttypes_real): Likewise.
2173 (ptr_reasonably_similar): Likewise.
2174 (comp_ptr_ttypes_const): Likewise.
2175 (casts_away_constness): Likewise.
2176 (check_literal_operator_args): Likewise.
2177 * typeck2.c (build_x_arrow): Likewise.
2178 (add_exception_specifier): Likewise.
2179
2180 2013-03-29 Jason Merrill <jason@redhat.com>
2181
2182 N3582
2183 * cp-tree.h (AUTO_IS_DECLTYPE): New.
2184 * parser.c (cp_parser_decltype): Handle decltype(auto).
2185 (cp_parser_type_id_1): Allow auto without a late-specified
2186 return in C++1y.
2187 (cp_parser_primary_expression): Use the return value of
2188 finish_parenthesized_expr.
2189 (cp_parser_transaction_expression): Likewise.
2190 * semantics.c (force_paren_expr): New.
2191 (finish_parenthesized_expr): Use it.
2192 * call.c (build_conditional_expr_1): Likewise.
2193 * pt.c (do_auto_deduction): Handle decltype(auto).
2194 (tsubst_copy): Handle PAREN_EXPR.
2195 (tsubst_copy_and_build): Likewise.
2196 * error.c (dump_expr): Handle PAREN_EXPR.
2197 * cxx-pretty-print.c (pp_cxx_expression): Likewise.
2198 * mangle.c (write_expression): Ignore PAREN_EXPR.
2199
2200 * parser.c (cp_parser_decltype_expr): Split out...
2201 (cp_parser_decltype): ...from here.
2202
2203 PR c++/56774
2204 PR c++/35722
2205 * pt.c (unify_pack_expansion): Fix indexing.
2206
2207 2013-03-29 Gabriel Dos Reis <gdr@integrable-solutions.net>
2208
2209 * call.c (build_java_interface_fn_ref): Likewise.
2210 (make_temporary_var_for_ref_to_temp): Likewise.
2211 * class.c (check_field_decls): Likewise.
2212 (layout_class_type): Likewise.
2213 (finish_struct_1): Likewise.
2214 (fixed_type_or_null): Likewise.
2215 (get_vtbl_decl_for_binfo): Likewise.
2216 * cp-gimplify.c (omp_var_to_track): Likewise.
2217 (cp_genericize_r): Likewise.
2218 * cp-objcp-common.c (cxx_warn_unused_global_decl): Likewise.
2219 * cp-tree.h (LANG_DECL_HAS_MIN): Likewise.
2220 (DECL_DISCRIMINATOR_P): Likewise.
2221 * decl.c (poplevel): Likewise.
2222 (decls_match): Likewise.
2223 (duplicate_decls): Likewise.
2224 (decl_jump_unsafe): Likewise.
2225 (start_decl): Likewise.
2226 (check_for_uninitialized_const_var): Likewise.
2227 (make_rtl_for_nonlocal_decl): Likewise.
2228 (cp_finish_decl): Likewise.
2229 (expand_static_init): Likewise.
2230 (local_variable_p): Likewise.
2231 (maybe_register_incomplete_var): Likewise.
2232 * decl2.c (grokfield): Likewise.
2233 (comdat_linkage): Likewise.
2234 (determine_visibility): Likewise.
2235 (import_export_decl): Likewise.
2236 (prune_vars_needing_no_initialization): Likewise.
2237 (decl_maybe_constant_var_p): Likewise.
2238 * error.c (dump_simple_decl): Likewise.
2239 (dump_template_decl): Likewise.
2240 (cp_printer): Likewise.
2241 * except.c (build_throw): Likewise.
2242 * init.c (build_vtbl_address): Likewise.
2243 (member_init_ok_or_else): Likewise.
2244 (build_aggr_init): Likewise.
2245 (expand_aggr_init_1): Likewise.
2246 (build_offset_ref): Likewise.
2247 (constant_value_1): Likewise.
2248 * mangle.c (write_mangled_name): Likewise.
2249 (write_prefix): Likewise.
2250 * name-lookup.c (supplement_binding_1): Likewise.
2251 (add_decl_to_level): Likewise.
2252 (pushdecl_maybe_friend_1): Likewise.
2253 (check_for_out_of_scope_variable): Likewise.
2254 (validate_nonmember_using_decl): Likewise.
2255 (lookup_name_innermost_nonclass_level_1): Likewise.
2256 (lookup_arg_dependent_1): Likewise.
2257 * parser.c (cp_parser_lambda_introducer): Likewise.
2258 (cp_parser_template_argument): Likewise.
2259 (cp_parser_single_declaration): Likewise.
2260 * pt.c (convert_nontype_argument): Likewise.
2261 (instantiate_class_template_1): Likewise.
2262 (tsubst_decl): Likewise.
2263 (tsubst_expr): Likewise.
2264 (do_decl_instantiation): Likewise.
2265 (do_type_instantiation): Likewise.
2266 (regenerate_decl_from_template): Likewise.
2267 (always_instantiate_p): Likewise.
2268 (instantiate_decl): Likewise.
2269 (type_dependent_expression_p): Likewise.
2270 (build_non_dependent_expr): Likewise.
2271 * repo.c (repo_emit_p): Likewise.
2272 * rtti.c (build_dynamic_cast_1): Likewise.
2273 * search.c (shared_member_p): Likewise.
2274 * semantics.c (outer_var_p): Likewise.
2275 (finish_id_expression): Likewise.
2276 (finish_omp_clauses): Likewise.
2277 (finish_decltype_type): Likewise.
2278 (ensure_literal_type_for_constexpr_object): Likewise.
2279 * tree.c (lvalue_kind): Likewise.
2280 (bot_replace): Likewise.
2281 (cp_tree_equal): Likewise.
2282 (handle_init_priority_attribute): Likewise.
2283 (decl_storage_duration): Likewise.
2284 * typeck.c (cxx_sizeof_expr): Likewise.
2285 (cxx_alignof_expr): Likewise.
2286 (decay_conversion): Likewise.
2287 (build_class_member_access_expr): Likewise.
2288 (cp_build_array_ref): Likewise.
2289 (cxx_mark_addressable): Likewise.
2290 (maybe_warn_about_returning_address_of_local): Likewise.
2291 (check_return_expr): Likewise.
2292 * typeck2.c (cxx_readonly_error): Likewise.
2293 (abstract_virtuals_error_sfinae): Likewise.
2294 (cxx_incomplete_type_diagnostic): Likewise.
2295
2296 2013-03-28 Lawrence Crowl <crowl@google.com>
2297
2298 * Make-lang.in
2299 (CXX_PARSER_H): Add header dependence.
2300 * cp-tree.h
2301 (extern debug (cp_binding_level &)): New.
2302 (extern debug (cp_binding_level *)): New.
2303 * name-lookup.h
2304 (debug (cp_binding_level &)): New.
2305 (debug (cp_binding_level *)): New.
2306 * parser.c
2307 (debug (cp_parser &)): New.
2308 (debug (cp_parser *)): New.
2309 (debug (cp_token &)): New.
2310 (debug (cp_token *)): New.
2311 (debug (vec<cp_token, va_gc> &)): New.
2312 (debug (vec<cp_token, va_gc> *)): New.
2313 * parser.c: Add header dependence.
2314 (extern debug (cp_parser &)): New.
2315 (extern debug (cp_parser *)): New.
2316 (extern debug (cp_token &)): New.
2317 (extern debug (cp_token *)): New.
2318 (extern debug (vec<cp_token, va_gc> &)): New.
2319 (extern debug (vec<cp_token, va_gc> *)): New.
2320
2321 2013-03-28 Jason Merrill <jason@redhat.com>
2322
2323 PR c++/17232
2324 PR c++/52748
2325 * typeck2.c (abstract_virtuals_error_sfinae): Don't complete
2326 the type if tf_decltype is set.
2327 * pt.c (fn_type_unification): Add decltype_p parm.
2328 (get_bindings): Adjust.
2329 * cp-tree.h: Adjust.
2330 * class.c (resolve_address_of_overloaded_function): Adjust.
2331 * call.c (add_template_candidate_real, print_z_candidate): Adjust.
2332
2333 PR c++/56679
2334 * parser.c (cp_parser_sizeof_pack): Split out from...
2335 (cp_parser_sizeof_operand): ...here. Require (id).
2336
2337 PR c++/56701
2338 * semantics.c (finish_this_expr): 'this' is an rvalue.
2339 * typeck.c (cp_build_indirect_ref): Handle NOP_EXPR of 'this'.
2340
2341 PR c++/56710
2342 * semantics.c (finish_member_declaration): Don't push closure
2343 members.
2344
2345 * name-lookup.c (pushdecl_maybe_friend_1): Use
2346 nonlambda_method_basetype and current_nonlambda_class_type.
2347
2348 PR c++/56728
2349 * semantics.c (potential_constant_expression_1) [NOP_EXPR]: Reject
2350 conversion from integer to pointer.
2351 (cxx_eval_constant_expression): Likewise.
2352 (cxx_eval_indirect_ref): Use the folded operand if we still think
2353 this might be constant.
2354
2355 2013-03-28 Paolo Carlini <paolo.carlini@oracle.com>
2356 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
2357
2358 PR c++/56725
2359 * call.c (convert_like_real): Change series of two permerrors
2360 to permerror + inform (and likewise for two errors).
2361 (build_new_method_call_1): Likewise.
2362 * typeck.c (convert_for_initialization): Change additional
2363 warning or error to inform.
2364
2365 2013-03-28 Gabriel Dos Reis <gdr@integrable-solutions.net>
2366
2367 * cp-tree.h (next_aggr_init_expr_arg): Remove static specifier.
2368 (first_aggr_init_expr): Likewise.
2369 (more_aggr_init_expr_args_p): Likewise.
2370 (type_of_this_parm): Likewise.
2371 (class_of_this_parm): Likewise.
2372 * name-lookup.h (get_global_value_if_present): Likewise.
2373 (is_typename_at_global_scope): Likewise.
2374
2375 2013-03-28 Paolo Carlini <paolo.carlini@oracle.com>
2376
2377 * call.c (joust): Don't call inform for a permerror returning false.
2378 * parser.c (cp_parser_check_class_key): Likewise.
2379 * pt.c (tsubst_copy_and_build): Likewise.
2380
2381 2013-03-27 Jason Merrill <jason@redhat.com>
2382
2383 PR c++/56749
2384 * semantics.c (finish_qualified_id_expr): Return early
2385 for enum scope.
2386
2387 2013-03-26 Gabriel Dos Reis <gdr@integrable-solutions.net>
2388
2389 * call.c (build_new_method_call_1): Use INDIRECT_REF_P.
2390 * cvt.c (convert_to_void): Likewise.
2391 * error.c (dump_expr): Likewise.
2392 * mangle.c (write_expression): Likewise.
2393 * parser.c (cp_parser_template_argument): Likewise.
2394 * pt.c (convert_nontype_argument): Likewise.
2395 (tsubst_copy_and_build): Likewise.
2396 * rtti.c (build_typeid): Likewise.
2397 * semantics.c (finish_call_expr): Likewise.
2398 (finish_decltype_type): Likewise.
2399 (build_data_member_initialization): Likewise.
2400 * tree.c (is_dummy_object): Likewise.
2401 * typeck.c (decay_conversion): Likewise.
2402 (build_class_member_access_expr): Likewise.
2403 (cp_build_addr_expr_1): Likewise.
2404 (unary_complex_lvalue): Likewise.
2405 (check_return_expr): Likewise.
2406 * typeck2.c (cxx_readonly_error): Likewise.
2407
2408 2013-03-26 Jason Merrill <jason@redhat.com>
2409
2410 PR c++/52597
2411 * typeck.c (invalid_nonstatic_memfn_p): Use get_first_fn. Take tree.
2412 * semantics.c (finish_decltype_type): Check it before type_unknown_p.
2413 * cp-tree.h: Adjust prototype.
2414
2415 PR c++/45282
2416 * typeck2.c (build_m_component_ref): Handle prvalue object.
2417
2418 2013-03-26 Gabriel Dos Reis <gdr@integrable-solutions.net>
2419
2420 * cp-gimplify.c (cp_genericize_r): Use VAR_OR_FUNCTION_DECL_P.
2421 * decl.c (duplicate_decls): Likewise.
2422 (cp_finish_decl): Likewise.
2423 (check_class_member_definition_namespace): Likewise.
2424 * decl2.c (grokfield): Likewise.
2425 (decl_needed_p): Likewise.
2426 (import_export_decl): Likewise.
2427 (mark_used): Likewise.
2428 * name-lookup.c (pushdecl_maybe_friend_1): Likewise.
2429 * pt.c (push_access_scope): Likewise.
2430 (instantiate_decl): Likewise.
2431 * ptree.c (cxx_print_decl): Likewise.
2432 * repo.c (repo_emit_p): Likewise.
2433 * semantics.c (note_decl_for_pch): Likewise.
2434 * tree.c (decl_linkage): Likewise.
2435
2436 2013-03-26 Paolo Carlini <paolo.carlini@oracle.com>
2437
2438 PR c++/55951
2439 * decl.c (check_array_designated_initializer): Handle CONST_DECL
2440 as ce->index.
2441
2442 2013-03-26 Paolo Carlini <paolo.carlini@oracle.com>
2443
2444 * decl.c (grokfndecl): Handle separately <inline> and <constexpr>
2445 error messages.
2446
2447 * decl.c (grokdeclarator): Declare typedef_p and use it everywhere.
2448
2449 2013-03-25 Jason Merrill <jason@redhat.com>
2450
2451 PR c++/56699
2452 * semantics.c (maybe_resolve_dummy): Make sure that the enclosing
2453 class is derived from the type of the object.
2454
2455 PR c++/52014
2456 * semantics.c (lambda_expr_this_capture): Don't capture 'this' in
2457 unevaluated context.
2458
2459 2013-03-25 Paolo Carlini <paolo.carlini@oracle.com>
2460
2461 PR c++/56722
2462 * decl.c (cp_finish_decl): Check DECL_LANG_SPECIFIC before
2463 DECL_TEMPLATE_INSTANTIATION.
2464
2465 2013-03-22 Jason Merrill <jason@redhat.com>
2466
2467 PR c++/56684
2468 * pt.c (instantiation_dependent_r): Check DECL_INITIAL of VAR_DECL
2469 and CONST_DECL.
2470
2471 2013-03-21 Gabriel Dos Reis <gdr@integrable-solutions.net>
2472
2473 * cp-tree.h (identifier_p): New.
2474 * call.c: Throughout, call identifier_p insstead of direct
2475 comparaison of TREE_CODE against IDENTIFIER_NODE.
2476 * decl.c: Likewisse.
2477 * decl2.c: Likewise.
2478 * init.c: Likewise.
2479 * mangle.c: Likewise.
2480 * name-lookup.c: Likewise.
2481 * parser.c: Likewise.
2482 * pt.c: Likewise.
2483 * search.c: Likewise.
2484 * semantics.c: Likewise.
2485 * tree.c: Likewise.
2486 * typeck.c: Likewise.
2487 * typeck2.c: Likewise.
2488
2489 2013-03-21 Jakub Jelinek <jakub@redhat.com>
2490
2491 PR middle-end/48087
2492 * pt.c (convert_nontype_argument): Count werrorcount as warnings.
2493 * call.c (build_temp): Likewise.
2494 * method.c (synthesize_method): Likewise.
2495 * typeck.c (convert_for_initialization): Likewise.
2496
2497 2013-03-21 Marc Glisse <marc.glisse@inria.fr>
2498
2499 * call.c (build_conditional_expr_1): Fold VEC_COND_EXPR.
2500
2501 2013-03-21 Richard Biener <rguenther@suse.de>
2502
2503 * error.c (cp_printer): Use DECL_HAS_DEBUG_EXPR_P instead of
2504 DECL_DEBUG_EXPR_IS_FROM. Guard properly.
2505
2506 2013-03-20 Jason Merrill <jason@redhat.com>
2507
2508 PR c++/56646
2509 * parser.c (cp_parser_late_return_type_opt): Save and restore
2510 current_class_ptr/ref.
2511
2512 PR c++/54532
2513 * expr.c (cplus_expand_constant): Do nothing if the class is
2514 incomplete.
2515 * semantics.c (reduced_constant_expression_p): Allow PTRMEM_CST.
2516 * typeck2.c (store_init_value): Use reduced_constant_expression_p.
2517 * decl.c (maybe_register_incomplete_var): Handle PTRMEM_CST.
2518 (complete_vars): Likewise.
2519
2520 * name-lookup.c (get_anonymous_namespace_name): Never use
2521 get_file_function_name.
2522
2523 * pt.c (retrieve_specialization): Handle null tmpl argument.
2524
2525 PR c++/17232
2526 PR c++/56642
2527 * pt.c (tsubst_decl): Check return value of register_specialization.
2528 * typeck2.c (abstract_virtuals_error_sfinae): Re-apply complete_type
2529 change.
2530
2531 2013-03-17 Jason Merrill <jason@redhat.com>
2532
2533 PR c++/54359
2534 PR c++/56639
2535 * parser.c (cp_parser_direct_declarator): Bail if we see a
2536 qualified-id not at namespace scope.
2537
2538 PR c++/17232
2539 PR c++/56642
2540 * typeck2.c (abstract_virtuals_error_sfinae): Revert complete_type
2541 change for now.
2542
2543 2013-03-16 Jason Merrill <jason@redhat.com>
2544
2545 * decl.c (grokdeclarator): Assert that we won't see a pointer to
2546 METHOD_TYPE.
2547
2548 PR c++/54277
2549 * cp-tree.h (WILDCARD_TYPE_P): Split out from...
2550 (MAYBE_CLASS_TYPE_P): ...here.
2551 * semantics.c (lambda_capture_field_type): Only build a
2552 magic decltype for wildcard types.
2553 (lambda_proxy_type): Likewise.
2554 (finish_non_static_data_member): Get the quals from
2555 the object.
2556
2557 PR c++/55931
2558 * parser.c (cp_parser_template_argument): Don't
2559 fold_non_dependent_expr.
2560
2561 * parser.c (cp_parser_lambda_declarator_opt): Use
2562 cp_parser_trailing_type_id.
2563
2564 PR c++/45917
2565 * parser.c (cp_parser_template_id): Don't forget access checks.
2566
2567 PR c++/52374
2568 * pt.c (tsubst_qualified_id): Use current_nonlambda_class_type.
2569
2570 PR c++/54764
2571 PR c++/55972
2572 * name-lookup.h (tag_scope): Add ts_lambda.
2573 * semantics.c (begin_lambda_type): Use it.
2574 * decl.c (xref_tag_1): Set CLASSTYPE_LAMBDA_EXPR.
2575 * pt.c (check_default_tmpl_args): Ignore lambdas.
2576 (push_template_decl_real): Handle lambdas.
2577 * tree.c (no_linkage_check): Adjust lambda check.
2578
2579 PR c++/56039
2580 * tree.c (strip_typedefs_expr): Complain about lambda, don't abort.
2581
2582 PR c++/54359
2583 * parser.c (cp_parser_direct_declarator): Fix late return
2584 for out-of-class defn of member function.
2585
2586 PR c++/55357
2587 * semantics.c (maybe_add_lambda_conv_op): Clear DECL_NAME of copied
2588 parms to avoid duplicate -Wshadow warnings.
2589
2590 * search.c (lookup_base): Handle NULL_TREE.
2591
2592 PR c++/56481
2593 * semantics.c (potential_constant_expression_1): Use of 'this' in
2594 a non-constexpr function makes the expression not potentially
2595 constant.
2596
2597 N3276
2598 PR c++/52748
2599 * cp-tree.h (tsubst_flags): Add tf_decltype.
2600 * call.c (build_cxx_call): Don't build a temporary if it's set.
2601 (build_over_call): Make sure it's only passed to build_cxx_call.
2602 * parser.c (cp_parser_primary_expression): Add decltype_p parm.
2603 (cp_parser_unary_expression): Likewise.
2604 (cp_parser_cast_expression): Likewise.
2605 (cp_parser_binary_expression): Likewise.
2606 (cp_parser_assignment_expression): Likewise.
2607 (cp_parser_postfix_expression): Likewise. Pass tf_decltype.
2608 (cp_parser_expression): Add decltype_p. Force a
2609 temporary for a call on the LHS of a comma.
2610 (cp_parser_decltype): Pass true to decltype_p parms.
2611 * pt.c (tsubst) [DECLTYPE_TYPE]: Pass tf_decltype.
2612 (tsubst_copy_and_build): Pass tf_decltype down only for
2613 CALL_EXPR and the RHS of COMPOUND_EXPR.
2614 * tree.c (build_cplus_new): Call complete_type_or_maybe_complain.
2615
2616 * cp-tree.h (abstract_class_use): New enum.
2617 * typeck2.c (pending_abstract_type): Add use field.
2618 (abstract_virtuals_error_sfinae): Add overloads taking
2619 abstract_class_use instead of tree.
2620 * typeck.c (build_static_cast_1): Call it.
2621 * except.c (is_admissible_throw_operand_or_catch_parameter): Call it.
2622 * pt.c: Adjust calls.
2623 * decl.c (cp_finish_decl): Don't handle functions specially.
2624 (grokdeclarator): Always check return type.
2625 * init.c (build_new_1): Adjust call.
2626
2627 DR 337
2628 PR c++/17232
2629 * pt.c (tsubst) [ARRAY_TYPE]: Use abstract_virtuals_error_sfinae.
2630 * typeck2.c (abstract_virtuals_error_sfinae): Call complete_type.
2631
2632 DR 657
2633 * pt.c (tsubst_function_type): Call abstract_virtuals_error_sfinae.
2634 (tsubst_arg_types): Likewise.
2635
2636 DR 1518
2637 PR c++/54835
2638 * call.c (convert_like_real): Check for explicit constructors
2639 even for value-initialization.
2640
2641 PR c++/54946
2642 * pt.c (convert_nontype_argument): Handle invalid pointer.
2643
2644 * parser.c (cp_parser_lambda_expression): Use nreverse.
2645
2646 PR c++/56447
2647 PR c++/55532
2648 * pt.c (instantiate_class_template_1): Instantiate lambda capture
2649 list here.
2650 (tsubst_copy_and_build): Not here.
2651
2652 PR c++/55017
2653 * method.c (walk_field_subobs): Disallow copy of rvalue ref.
2654
2655 PR c++/55240
2656 * parser.c (parsing_nsdmi): New.
2657 * semantics.c (outer_automatic_var_p): Check it.
2658 (finish_id_expression): Likewise.
2659 * cp-tree.h: Declare it.
2660
2661 PR c++/55241
2662 * error.c (dump_expr) [SIZEOF_EXPR]: Print sizeof... properly.
2663
2664 * parser.c (lookup_literal_operator): Correct parm/arg naming
2665 mixup.
2666
2667 PR c++/56238
2668 * pt.c (fold_non_dependent_expr_sfinae): Check
2669 instantiation_dependent_expression_p.
2670
2671 PR c++/56095
2672 * class.c (resolve_address_of_overloaded_function): Accept a
2673 reference to function for target_type.
2674 (instantiate_type): Likewise.
2675 * pt.c (convert_nontype_argument): Pass it to
2676 convert_nontype_argument_function.
2677
2678 2013-03-16 Jakub Jelinek <jakub@redhat.com>
2679
2680 * tree.c (cp_tree_equal): Fix a pasto.
2681
2682 PR c++/56607
2683 * typeck.c (cp_build_binary_op): When calling warn_for_div_by_zero,
2684 pass op1 through maybe_constant_value first.
2685
2686 2013-03-16 Paolo Carlini <paolo.carlini@oracle.com>
2687
2688 PR c++/56582
2689 * semantics.c (cxx_eval_array_reference): Check for negative index.
2690
2691 2013-03-14 Jason Merrill <jason@redhat.com>
2692
2693 PR c++/56614
2694 * decl.c (local_variable_p_walkfn): Check DECL_ARTIFICIAL again.
2695
2696 PR c++/56346
2697 * decl.c (register_dtor_fn): Pass null to __cxa_thread_atexit
2698 dso_handle parm on targets without __cxa_atexit.
2699
2700 2013-03-11 Jason Merrill <jason@redhat.com>
2701
2702 PR c++/56567
2703 * typeck.c (check_return_expr): Disallow returning init list here.
2704 * semantics.c (apply_deduced_return_type): Not here.
2705
2706 2013-03-08 Paolo Carlini <paolo.carlini@oracle.com>
2707
2708 PR c++/51412
2709 * cxx-pretty-print.c (pp_cxx_expression): Handle LAMBDA_EXPR.
2710 * error.c (dump_expr): Likewise.
2711
2712 2013-03-08 Jason Merrill <jason@redhat.com>
2713
2714 PR c++/51884
2715 * class.c (modify_all_vtables): Mangle the vtable name before
2716 entering dfs_walk.
2717
2718 * semantics.c (lambda_expr_this_capture): In unevaluated context,
2719 just return the nearest 'this'.
2720
2721 PR c++/51494
2722 PR c++/52183
2723 PR c++/56222
2724 * tree.c (maybe_dummy_object): Don't capture 'this'.
2725 * semantics.c (maybe_resolve_dummy): New.
2726 (finish_non_static_data_member): Use it.
2727 (finish_qualified_id_expr): Don't test is_dummy_object.
2728 * cp-tree.h: Declare maybe_resolve_dummy.
2729 * call.c (build_new_method_call_1): Use it.
2730
2731 PR c++/56567
2732 * semantics.c (apply_deduced_return_type): Don't allow returning
2733 std::initializer_list.
2734
2735 2013-03-06 Paolo Carlini <paolo.carlini@oracle.com>
2736
2737 PR c++/56534
2738 * parser.c (cp_parser_elaborated_type_specifier): Don't call
2739 check_elaborated_type_specifier when TREE_CODE (decl) != TYPE_DECL.
2740 * decl.c (check_elaborated_type_specifier): Tidy.
2741
2742 2013-03-06 Jakub Jelinek <jakub@redhat.com>
2743
2744 PR c++/56543
2745 * tree.c (strip_typedefs): Don't copy args if they are NULL.
2746
2747 2013-03-05 Jakub Jelinek <jakub@redhat.com>
2748
2749 * parser.c (cp_parser_braced_list): For {} initialize
2750 *non_constant_p to false.
2751
2752 2013-03-04 Jason Merrill <jason@redhat.com>
2753
2754 PR c++/56464
2755 PR c++/54383
2756 * semantics.c (lambda_expr_this_capture): Handle NSDMI
2757 and non-class scopes.
2758
2759 2013-03-01 Paolo Carlini <paolo.carlini@oracle.com>
2760
2761 * decl.c (grokdeclarator): Remove dead code.
2762
2763 2013-02-28 Jason Merrill <jason@redhat.com>
2764
2765 PR c++/56481
2766 * semantics.c (potential_constant_expression_1): Use
2767 cxx_eval_outermost_constant_expr rather than maybe_constant_value.
2768
2769 PR c++/56243
2770 * call.c (build_over_call): Avoid virtual lookup in a template.
2771
2772 2013-02-27 Jason Merrill <jason@redhat.com>
2773
2774 PR c++/56358
2775 PR c++/56323
2776 * name-lookup.c (do_class_using_decl): Use ctor_identifier instead
2777 of the base name for inheriting ctors.
2778 (push_class_level_binding_1): Remove inheriting ctor handling.
2779 * pt.c (tsubst_decl) [USING_DECL]: Likewise.
2780 * class.c (add_implicitly_declared_members): Adjust.
2781
2782 2013-02-26 David Binderman <dcb314@hotmail.com>
2783
2784 PR c++/55632
2785 * decl.c (grokdeclarator): Tidy publicp assignment.
2786
2787 2013-02-25 Aldy Hernandez <aldyh@redhat.com>
2788
2789 PR c++/56419
2790 * semantics.c (begin_transaction_stmt): Set TREE_SIDE_EFFECTS.
2791 (build_transaction_expr): Same.
2792
2793 2013-02-25 Jason Merrill <jason@redhat.com>
2794
2795 PR c++/56377
2796 * pt.c (fn_type_unification): Wait to call push_tinst_level until
2797 we know what args we're looking at.
2798
2799 PR c++/56438
2800 * semantics.c (potential_constant_expression_1): In C++98, a cast
2801 to non-integral type can't be a constant expression.
2802
2803 2013-02-24 Jakub Jelinek <jakub@redhat.com>
2804
2805 PR c++/56403
2806 * init.c (build_zero_init_1): Use RECORD_OR_UNION_CODE_P instead
2807 of CLASS_TYPE_P.
2808
2809 2013-02-22 Jason Merrill <jason@redhat.com>
2810
2811 PR c++/40405
2812 * pt.c (push_template_decl_real): Set DECL_INTERFACE_KNOWN
2813 if we got the wrong number of template parms.
2814
2815 PR c++/56377
2816 * pt.c (fn_type_unification): Use explicit args in template
2817 instantiation context.
2818
2819 PR c++/56359
2820 * call.c (can_convert_arg): Discard access checks.
2821
2822 PR c++/56395
2823 * tree.c (strip_typedefs): Strip typedefs from TYPENAME_TYPE template
2824 args.
2825
2826 2013-02-20 Paolo Carlini <paolo.carlini@oracle.com>
2827
2828 PR c++/56373
2829 * tree.c (maybe_warn_zero_as_null_pointer_constant): Add.
2830 * cvt.c (ocp_convert): Use the latter.
2831 (cp_convert_to_pointer): Likewise.
2832 * decl.c (check_default_argument): Likewise.
2833 * typeck.c (cp_build_binary_op): Likewise.
2834 * cp-tree.h (maybe_warn_zero_as_null_pointer_constant): Declare.
2835
2836 2013-02-15 Jonathan Wakely <jwakely.gcc@gmail.com>
2837 Paolo Carlini <paolo.carlini@oracle.com>
2838
2839 PR c++/51242
2840 * decl2.c (grokbitfield): Allow scoped enumeration types.
2841
2842 2013-02-15 Jason Merrill <jason@redhat.com>
2843
2844 PR c++/54276
2845 * semantics.c (finish_id_expression): Also return the identifier
2846 for an outer local static.
2847
2848 PR c++/56343
2849 * class.c (check_bases_and_members): Deduce noexcept after
2850 checking bases.
2851
2852 PR c++/52026
2853 * semantics.c (finish_id_expression): In a template, return
2854 the identifier for a constant variable.
2855
2856 2013-02-14 Jason Merrill <jason@redhat.com>
2857
2858 PR c++/54922
2859 * semantics.c (build_anon_member_initialization): New.
2860 (build_data_member_initialization): Use it.
2861
2862 PR c++/55003
2863 * decl.c (cp_finish_decl): Force instantiation of an
2864 auto static data member.
2865
2866 PR c++/55220
2867 * pt.c (unify): A pack expansion that is not the last template
2868 argument makes the entire template argument list non-deduced.
2869
2870 PR c++/56323
2871 * name-lookup.c (do_class_using_decl): Handle typedefs with
2872 inheriting constructors.
2873 (push_class_level_binding_1): Allow inheriting from template
2874 template parameter, too.
2875 * pt.c (tsubst_decl) [USING_DECL]: Likewise.
2876
2877 PR c++/55223
2878 * pt.c (tsubst_copy_and_build) [LAMBDA_EXPR]: Fix handling of
2879 default argument scope.
2880 * mangle.c (write_name): Likewise.
2881
2882 PR c++/55232
2883 * error.c (find_typenames_r): Don't walk into a pack expansion.
2884
2885 2013-02-13 Jason Merrill <jason@redhat.com>
2886
2887 PR c++/55670
2888 * parser.c (cp_parser_member_declaration): Check the declarator
2889 form when detecting a function declaration via typedef.
2890
2891 PR c++/55680
2892 * pt.c (maybe_process_partial_specialization): A lambda
2893 isn't what's being specialized.
2894
2895 PR c++/55710
2896 * semantics.c (maybe_add_lambda_conv_op): Mark static thunk
2897 TREE_USED.
2898
2899 PR c++/55879
2900 * semantics.c (cxx_bind_parameters_in_call): Undo DECL_BY_REFERENCE.
2901
2902 PR c++/55993
2903 * semantics.c (cxx_fold_indirect_ref): Handle empty bases at
2904 non-zero offsets, too.
2905
2906 PR c++/56155
2907 * decl.c (build_enumerator): Always convert the value to a
2908 fixed underlying type.
2909
2910 PR c++/56135
2911 * pt.c (tsubst_copy_and_build): Don't forget any new
2912 captures that arose from use of dependent names.
2913
2914 2013-02-13 Jakub Jelinek <jakub@redhat.com>
2915
2916 PR c++/56302
2917 * semantics.c (finish_asm_stmt): If input constraints allow
2918 neither register nor memory, try maybe_constant_value to get
2919 a constant if possible.
2920
2921 2013-02-12 Jason Merrill <jason@redhat.com>
2922
2923 PR c++/56285
2924 * method.c (add_one_base_init): Handle base constructor
2925 taking rvalue reference parm.
2926
2927 PR c++/56291
2928 * semantics.c (sort_constexpr_mem_initializers): Handle
2929 vptr out of order.
2930
2931 2013-02-09 Jason Merrill <jason@redhat.com>
2932
2933 PR c++/56268
2934 * semantics.c (classtype_has_nothrow_assign_or_copy_p): Call
2935 maybe_instantiate_noexcept.
2936
2937 PR c++/56247
2938 * pt.c (eq_specializations): Set comparing_specializations.
2939 * tree.c (cp_tree_equal): Check it.
2940 * cp-tree.h: Declare it.
2941
2942 * decl.c (decls_match): Check versions later.
2943
2944 PR c++/56238
2945 * pt.c (build_non_dependent_expr): Don't try to fold
2946 instantiation-dependent expressions.
2947 (instantiation_dependent_r) [TRAIT_EXPR]: Split out.
2948 [BIND_EXPR]: Treat as dependent.
2949
2950 2013-02-07 Jakub Jelinek <jakub@redhat.com>
2951
2952 PR c++/56241
2953 * init.c (build_vec_init): Don't append NULL values into new_vec.
2954 (build_zero_init_1): Don't push anything into v if recursive call
2955 returned NULL_TREE.
2956 (build_value_init_noctor): Don't push anything into v if
2957 build_value_init call returned NULL_TREE.
2958
2959 PR c++/56239
2960 * parser.c (cp_parser_token_starts_cast_expression): Renamed to...
2961 (cp_parser_tokens_start_cast_expression): ... this. Change parameter
2962 to cp_parser *, call cp_lexer_peek_token first. For CPP_OPEN_PAREN,
2963 return true only if 2nd token isn't CPP_CLOSE_PAREN.
2964 (cp_parser_cast_expression): Adjust caller.
2965
2966 PR c++/56237
2967 * decl.c (push_local_name): Look at DECL_DISCRIMINATOR (t)
2968 only if DECL_DISCRIMINATOR_SET_P (t) rather than just
2969 DECL_LANG_SPECIFIC (t).
2970
2971 2013-02-07 Jason Merrill <jason@redhat.com>
2972
2973 PR c++/56235
2974 * method.c (do_build_copy_constructor): Don't bother turning
2975 scalars from lvalues to xvalues.
2976 (do_build_copy_assign): Likewise.
2977
2978 2013-02-06 Jason Merrill <jason@redhat.com>
2979
2980 * parser.c (cp_parser_enum_specifier): Check for error_mark_node.
2981
2982 2013-02-05 Jason Merrill <jason@redhat.com>
2983
2984 PR c++/54122
2985 * tree.c (lvalue_kind) [INDIRECT_REF]: Don't check for
2986 METHOD_TYPE.
2987
2988 PR c++/56177
2989 * decl.c (start_preparsed_function): Update restype if we change
2990 decl1.
2991
2992 PR c++/56208
2993 * pt.c (fn_type_unification): Discard any access checks from
2994 substituting explicit args.
2995
2996 2013-01-31 Jason Merrill <jason@redhat.com>
2997
2998 PR c++/56162
2999 PR c++/56104
3000 * typeck.c (get_member_function_from_ptrfunc): Fix
3001 ptrmemfunc_vbit_in_delta case.
3002
3003 2013-01-29 Jason Merrill <jason@redhat.com>
3004
3005 PR libstdc++/54314
3006 * class.c (build_ctor_vtbl_group): Give construction vtables
3007 hidden visibility.
3008
3009 2013-01-25 Jason Merrill <jason@redhat.com>
3010
3011 PR c++/56095
3012 * pt.c (convert_nontype_argument_function): Handle invalid input.
3013 (convert_nontype_argument): Likewise.
3014
3015 PR c++/56104
3016 * typeck.c (get_member_function_from_ptrfunc): Optimize if the
3017 dynamic type has no virtual functions.
3018
3019 2013-01-22 Paolo Carlini <paolo.carlini@oracle.com>
3020
3021 PR c++/55944
3022 * decl.c (check_initializer): Use TARGET_EXPR_DIRECT_INIT_P only
3023 on TARGET_EXPR nodes.
3024
3025 2013-01-22 Jason Merrill <jason@redhat.com>
3026
3027 PR c++/56071
3028 * pt.c (maybe_instantiate_noexcept): Don't defer access checks.
3029
3030 2013-01-22 Dodji Seketeli <dodji@redhat.com>
3031
3032 PR c++/53609
3033 * pt.c (argument_pack_element_is_expansion_p)
3034 (make_argument_pack_select, use_pack_expansion_extra_args_p)
3035 (gen_elem_of_pack_expansion_instantiation): New static functions.
3036 (tsubst): When looking through an ARGUMENT_PACK_SELECT tree node,
3037 look through the possibly resulting pack expansion as well.
3038 (tsubst_pack_expansion): Use use_pack_expansion_extra_p to
3039 generalize when to use the PACK_EXPANSION_EXTRA_ARGS mechanism.
3040 Use gen_elem_of_pack_expansion_instantiation to build the
3041 instantiation piece-wise. Don't use arg_from_parm_pack_p anymore,
3042 as gen_elem_of_pack_expansion_instantiation and the change in
3043 tsubst above generalize this particular case.
3044 (arg_from_parm_pack_p): Remove this for it's not used by
3045 tsubst_pack_expansion anymore.
3046
3047 2013-01-21 Jason Merrill <jason@redhat.com>
3048
3049 PR c++/56059
3050 * tree.c (strip_typedefs_expr) [TREE_VEC]: Preserve non-default
3051 template args count.
3052
3053 2013-01-18 Jason Merrill <jason@redhat.com>
3054
3055 PR target/54908
3056 * decl2.c (get_local_tls_init_fn): New.
3057 (get_tls_init_fn): Handle flag_extern_tls_init. Don't bother
3058 with aliases for internal variables. Don't use weakrefs if
3059 the variable needs destruction.
3060 (generate_tls_wrapper): Mark the wrapper as const if no
3061 initialization is needed.
3062 (handle_tls_init): Don't require aliases.
3063
3064 2013-01-15 Dodji Seketeli <dodji@redhat.com>
3065
3066 PR c++/55663
3067 * pt.c (coerce_innermost_template_parms): New static function.
3068 (instantiate_alias_template): Use it here.
3069
3070 2013-01-09 Jason Merrill <jason@redhat.com>
3071
3072 PR c++/55878
3073 * rtti.c (build_typeid, get_typeid): Add complain parm.
3074 (get_tinfo_decl_dynamic): Likewise.
3075 * cp-tree.h, parser.c, pt.c: Adjust.
3076
3077 PR c++/55893
3078 * decl.c (cp_finish_decl): Clear TREE_READONLY if the variable
3079 needs destruction.
3080
3081 2013-01-09 Jakub Jelinek <jakub@redhat.com>
3082
3083 PR c/48418
3084 * typeck.c (cp_build_binary_op): For LSHIFT_EXPR and RSHIFT_EXPR,
3085 call maybe_constant_value for the negative or too big shift
3086 count warnings.
3087
3088 2013-01-09 Paolo Carlini <paolo.carlini@oracle.com>
3089
3090 PR c++/55801
3091 * decl2.c (var_needs_tls_wrapper): Return false when error_operand_p
3092 of the argument is true.
3093
3094 2013-01-08 Joel Brobecker <brobecker@adacore.com>
3095
3096 * parser.c (cp_parser_initializer_list): Move declaration
3097 of variable non_const to start of lexical block.
3098
3099 2013-01-07 Jason Merrill <jason@redhat.com>
3100
3101 PR c++/55753
3102 * tree.c (build_aggr_init_expr): Do nothing in a template.
3103 * pt.c (tsubst_copy_and_build) [CALL_EXPR]: Strip an ADDR_EXPR off
3104 a FUNCTION_DECL before tsubsting.
3105
3106 2013-01-04 Dodji Seketeli <dodji@redhat.com>
3107
3108 PR c++/52343
3109 * pt.c (check_instantiated_arg): Allow type template arguments.
3110
3111 2013-01-04 Jason Merrill <jason@redhat.com>
3112
3113 PR c++/55877
3114 * decl.c (reset_type_linkage, bt_reset_linkage): New.
3115 (grokdeclarator): Use reset_type_linkage.
3116 * name-lookup.c (binding_table_foreach): Handle null table.
3117 * tree.c (decl_anon_ns_mem_p): Check TYPE_MAIN_DECL, not TYPE_NAME.
3118
3119 2013-01-04 Paolo Carlini <paolo.carlini@oracle.com>
3120
3121 PR c++/54526 (again)
3122 * parser.c (cp_parser_template_id): Revert core of previous change
3123 (keep adjusted inform message).
3124
3125 2013-01-03 Jason Merrill <jason@redhat.com>
3126
3127 PR c++/55419
3128 PR c++/55753
3129 * pt.c (tsubst_copy_and_build) [TARGET_EXPR]: Don't touch
3130 TREE_CONSTANT.
3131
3132 PR c++/55842
3133 * semantics.c (trait_expr_value): Call maybe_instantiate_noexcept.
3134
3135 PR c++/55856
3136 * semantics.c (build_data_member_initialization): Handle DECL_EXPR.
3137
3138 PR c++/53650
3139 * call.c (type_has_extended_temps): New.
3140 * cp-tree.h: Declare it.
3141 * decl.c (check_initializer): Use build_aggr_init for arrays
3142 if it is false.
3143 * init.c (build_vec_init): Avoid mixed signed/unsigned arithmetic.
3144
3145 2013-01-02 Jason Merrill <jason@redhat.com>
3146
3147 PR c++/54325
3148 * call.c (build_new_method_call_1): Don't use build_value_init for
3149 user-provided default constructors.
3150
3151 * decl.c (check_default_argument): Use LOOKUP_IMPLICIT.
3152
3153 PR c++/55032
3154 PR c++/55245
3155 * tree.c (build_cplus_array_type): Copy layout information
3156 to main variant if necessary.
3157 \f
3158 Copyright (C) 2013 Free Software Foundation, Inc.
3159
3160 Copying and distribution of this file, with or without modification,
3161 are permitted in any medium without royalty provided the copyright
3162 notice and this notice are preserved.