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