aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp
AgeCommit message (Collapse)AuthorFilesLines
2013-05-06re PR c++/57183 ([C++11] auto and -Wunused-variable)Paolo Carlini2-0/+7
/cp 2013-05-06 Paolo Carlini <paolo.carlini@oracle.com> PR c++/57183 * decl.c (cp_finish_decl): After do_auto_deduction copy the qualifers with cp_apply_type_quals_to_decl. /testsuite 2013-05-06 Paolo Carlini <paolo.carlini@oracle.com> PR c++/57183 * g++.dg/cpp0x/auto38.C: New. From-SVN: r198636
2013-05-05pt.c (convert_nontype_argument): Add missing whitespace in error message.Paolo Carlini2-1/+6
2013-05-05 Paolo Carlini <paolo.carlini@oracle.com> * pt.c (convert_nontype_argument): Add missing whitespace in error message. From-SVN: r198608
2013-05-05re PR c++/53745 ([C++11] Poor diagnostic for ill-formed narrowing conversion ↵Paolo Carlini2-2/+7
in enumerator initializer) /cp 2013-05-04 Paolo Carlini <paolo.carlini@oracle.com> PR c++/53745 * decl.c (build_enumerator): Improve error message. /testsuite 2013-05-04 Paolo Carlini <paolo.carlini@oracle.com> PR c++/53745 * g++.dg/cpp0x/enum27.C: New. * g++.dg/cpp0x/enum_base.C: Adjust. From-SVN: r198607
2013-05-03re PR c++/14283 (Diagnostic for invalid template-id could be improved)Paolo Carlini2-4/+26
/cp 2013-05-03 Paolo Carlini <paolo.carlini@oracle.com> PR c++/14283 * parser.c (cp_parser_diagnose_invalid_type_name): Improve error messages for template types and fix column numbers. /testsuite 2013-05-03 Paolo Carlini <paolo.carlini@oracle.com> PR c++/14283 * g++.dg/parse/error51.C: New. * g++.dg/parse/error15.C: Adjust column numbers. From-SVN: r198572
2013-05-01re PR c++/57132 (spurious warning: division by zero [-Wdiv-by-zero] in if ↵Paolo Carlini2-1/+14
(m) res %=m;) /cp 2013-05-01 Paolo Carlini <paolo.carlini@oracle.com> PR c++/57132 * pt.c (tsubst_copy_and_build, MODOP_EXPR): Increase / decrease c_inhibit_evaluation_warnings around build_x_modify_expr call. /testsuite 2013-05-01 Paolo Carlini <paolo.carlini@oracle.com> PR c++/57132 * g++.dg/warn/Wdiv-by-zero-bogus-2.C: New. From-SVN: r198504
2013-05-01re PR c++/57092 (Using decltype of function pointer type to define a data ↵Paolo Carlini2-2/+9
member causes compiler crash) /cp 2013-05-01 Paolo Carlini <paolo.carlini@oracle.com> PR c++/57092 * semantics.c (finish_decltype_type): Handle instantiated template non-type arguments. /testsuite 2013-05-01 Paolo Carlini <paolo.carlini@oracle.com> PR c++/57092 * g++.dg/cpp0x/decltype53.C: New. From-SVN: r198487
2013-04-28re PR c++/56450 (ICE with SFINAE when detecting non-static member variable)Paolo Carlini2-0/+6
/cp 2013-04-28 Paolo Carlini <paolo.carlini@oracle.com> PR c++/56450 * semantics.c (finish_decltype_type): Handle COMPOUND_EXPR. /testsuite 2013-04-28 Paolo Carlini <paolo.carlini@oracle.com> PR c++/56450 * g++.dg/cpp0x/decltype52.C: New. From-SVN: r198381
2013-04-26diagnostic.h (file_name_as_prefix): Add context argument.Jakub Jelinek2-1/+6
* diagnostic.h (file_name_as_prefix): Add context argument. * diagnostic.c (file_name_as_prefix): Likewise. Colorize the string as locus. * langhooks.c (lhd_print_error_function): Adjust caller. cp/ * error.c (cp_print_error_function): Adjust file_name_as_prefix caller. From-SVN: r198331
2013-04-25re PR c++/56859 (alignas() fails in template)Jason Merrill2-14/+10
PR c++/56859 * typeck.c (cxx_alignas_expr): Handle value-dependence properly. From-SVN: r198310
2013-04-25re PR c++/50261 ([C++0x] ICE on brace-initialize an array member)Jason Merrill2-1/+11
PR c++/50261 * init.c (perform_member_init): Call reshape_init. From-SVN: r198309
2013-04-24re PR c++/53721 ([C++11] "this" not allowed in trailing return type)Jason Merrill2-1/+6
PR c++/53721 * parser.c (cp_parser_postfix_dot_deref_expression): Fix thinko. From-SVN: r198257
2013-04-24c.opt ([Wpointer-arith]): Enabled by -Wpedantic, as documented.Paolo Carlini2-3/+8
/c-family 2013-04-24 Paolo Carlini <paolo.carlini@oracle.com> Manuel Lopez-Ibanez <manu@gcc.gnu.org> * c.opt ([Wpointer-arith]): Enabled by -Wpedantic, as documented. * c-common.c (pointer_int_sum): Change -Wpointer-arith pedwarns to simply use OPT_Wpointer_arith. (c_sizeof_or_alignof_type): Likewise. /cp 2013-04-24 Paolo Carlini <paolo.carlini@oracle.com> * typeck.c (cxx_sizeof_or_alignof_type): Change -Wpointer-arith pedwarn to simply use OPT_Wpointer_arith. (cp_build_unary_op): Likewise. /c 2013-04-24 Paolo Carlini <paolo.carlini@oracle.com> * c-typeck.c (pointer_diff): Change -Wpointer-arith pedwarns to simply use OPT_Wpointer_arith. (build_unary_op): Likewise. /testsuite 2013-04-24 Paolo Carlini <paolo.carlini@oracle.com> * c-c++-common/Wpointer-arith-1.c: New. Co-Authored-By: Manuel López-Ibáñez <manu@gcc.gnu.org> From-SVN: r198256
2013-04-24N3648: init-captures are named.Jason Merrill3-7/+21
* semantics.c (add_capture): Don't prepend "__" to init-captures. (build_capture_proxy): Adjust. * error.c (dump_simple_decl): Check DECL_NORMAL_CAPTURE_P. From-SVN: r198247
2013-04-24N3648: Allow braced and parenthesized initializers.Jason Merrill5-13/+40
* parser.c (cp_parser_lambda_introducer): Use cp_parser_initializer. * pt.c (tsubst) [DECLTYPE_TYPE]: Handle DECLTYPE_FOR_INIT_CAPTURE. * semantics.c (lambda_capture_field_type): Use do_auto_deduction. (add_capture): Collapse a parenthesized initializer into a single expression. * cp-tree.h (DECLTYPE_FOR_INIT_CAPTURE): New. From-SVN: r198246
2013-04-24re PR c++/56970 (SFINAE does not apply correctly to sizeof.)Paolo Carlini6-21/+41
/cp 2013-04-24 Paolo Carlini <paolo.carlini@oracle.com> PR c++/56970 * init.c (build_offset_ref): Add tsubst_flags_t parameter. * semantics.c (finish_qualified_id_expr): Likewise. (finish_id_expression): Update. * typeck.c (cp_build_addr_expr_1): Likewise. * pt.c (tsubst_qualified_id, resolve_nondeduced_context): Likewise. * cp-tree.h: Update declarations. /testsuite 2013-04-24 Paolo Carlini <paolo.carlini@oracle.com> PR c++/56970 * g++.dg/cpp0x/sfinae45.C: New. From-SVN: r198232
2013-04-22Core 1586Jason Merrill4-7/+53
Core 1586 * parser.c (cp_parser_unqualified_id): Handle ~auto. (cp_parser_pseudo_destructor_name): Likewise. (cp_parser_postfix_dot_deref_expression): Adjust. (cp_lexer_nth_token_is_keyword): New. * semantics.c (finish_pseudo_destructor_expr): Handle ~auto. * typeck.c (lookup_destructor): Handle ~auto. From-SVN: r198162
2013-04-22pt.c (fn_type_unification): Push tinst level around type_unification_real if ↵Jason Merrill4-3/+26
we aren't explaining. gcc/cp/ * pt.c (fn_type_unification): Push tinst level around type_unification_real if we aren't explaining. * cp-tree.h (TFF_NO_TEMPLATE_BINDINGS): New. * error.c (dump_function_decl): Respect it. (subst_to_string): Pass it. libstdc++-v3/ * testsuite/lib/prune.exp (libstdc++-dg-prune): Also ignore "In substitution" lines. From-SVN: r198161
2013-04-22re PR c++/48665 (type of const member function)Jason Merrill3-0/+29
PR c++/48665 * rtti.c (get_typeid): Diagnose qualified function type. * pt.c (tsubst) [POINTER_TYPE]: Likewise. From-SVN: r198160
2013-04-22error.c (dump_aggr_type): Fix lambda detection.Jason Merrill2-2/+14
* error.c (dump_aggr_type): Fix lambda detection. (dump_simple_decl): Pretty-print capture field. From-SVN: r198159
2013-04-22N3323Jason Merrill2-8/+19
* cvt.c (build_expr_type_conversion): Two conversions that return the same type aren't necessarily ambiguous. From-SVN: r198157
2013-04-22N3648Jason Merrill2-3/+8
* parser.c (cp_parser_lambda_introducer): Make lambda capture init pedwarn unconditional except in C++1y mode. From-SVN: r198156
2013-04-22semantics.c (potential_constant_expression_1): Don't crash on 'this' in NSDMI.Jason Merrill2-1/+5
* semantics.c (potential_constant_expression_1): Don't crash on 'this' in NSDMI. From-SVN: r198154
2013-04-22Core 1612Jason Merrill2-0/+10
Core 1612 * semantics.c (finish_id_expression): Reject capture of anonymous union member. From-SVN: r198153
2013-04-22Core 1609Jason Merrill2-1/+4
Core 1609 * decl2.c (check_default_args): Check for pack expansion. From-SVN: r198152
2013-04-22* mangle.c (write_type): Mangle decltype(auto).Jason Merrill2-1/+8
From-SVN: r198150
2013-04-19N3638 changes to return type deductionJason Merrill9-29/+117
* decl.c (undeduced_auto_decl): New. (require_deduced_type): New. (fndecl_declared_return_type): New. (decls_match): Use it. (duplicate_decls): Don't check for auto return. (grokdeclarator): Reject virtual auto. * class.c (resolve_address_of_overloaded_function): Handle auto function templates. * decl2.c (mark_used): Use undeduced_auto_decl, require_deduced_type. * cp-tree.h: Declare new fns. * error.c (dump_function_decl): Use fndecl_declared_return_type. * search.c (check_final_overrider): Likewise. * pt.c (make_decltype_auto): New. (do_auto_deduction): Require plain decltype(auto). (is_auto): Adjust. From-SVN: r198099
2013-04-19DR 941Jason Merrill2-4/+14
DR 941 * decl.c (duplicate_decls): Don't propagate DECL_DELETED_FN to template specializations. From-SVN: r198098
2013-04-17Implement n3599 String literal operator templates.Ed Smith-Rowland2-5/+75
From-SVN: r198018
2013-04-15* pt.c (tsubst) [DECLTYPE_TYPE]: Use tsubst_copy_and_build.Jason Merrill2-3/+6
From-SVN: r197983
2013-04-15re PR c++/52748 ([C++11] N3276 changes to decltype)Jason Merrill2-17/+32
PR c++/52748 * pt.c (tsubst) [DECLTYPE_TYPE]: If ~id is an expression rather than a destructor name, it isn't an unqualified-name. (tsubst_copy_and_build): Pass down decltype_flag to operator handling code, too. From-SVN: r197982
2013-04-15re PR c++/56388 (catch(...) in lambda rejected)Jason Merrill2-3/+8
PR c++/56388 * semantics.c (insert_capture_proxy): Just use index 1 in the stmt_list_stack. From-SVN: r197981
2013-04-12opts.c: Include diagnostic-color.h.Jakub Jelinek2-18/+26
* opts.c: Include diagnostic-color.h. (common_handle_option): Handle OPT_fdiagnostics_color_. * Makefile.in (OBJS-libcommon): Add diagnostic-color.o. (diagnostic.o, opts.o, pretty-print.o): Depend on diagnostic-color.h. (diagnostic-color.o): New. * common.opt (fdiagnostics-color, fdiagnostics-color=): New options. (diagnostic_color_rule): New enum. * dwarf2out.c (gen_producer_string): Don't print -fdiagnostics-color*. * langhooks.c (lhd_print_error_function): Add %r "locus" and %R around the location string. * diagnostic.def: Add 3rd argument to DEFINE_DIAGNOSTIC_KIND macros, either NULL, or color kind. * diagnostic-color.c: New file. * diagnostic-color.h: New file. * diagnostic-core.h (DEFINE_DIAGNOSTIC_KIND): Adjust macro for 3 arguments. * doc/invoke.texi (-fdiagnostics-color): Document. * pretty-print.h (pp_show_color): Define. (struct pretty_print_info): Add show_color field. * diagnostic.c: Include diagnostic-color.h. (diagnostic_build_prefix): Adjust for 3 argument DEFINE_DIAGNOSTIC_KIND macros. Colorize error:, warning: etc. strings and also the location string. (diagnostic_show_locus): Colorize the caret line. * pretty-print.c: Include diagnostic-color.h. (pp_base_format): Handle %r and %R format specifiers. Colorize strings inside of %< %> quotes or quoted through q format modifier. c-family/ * c-format.c (gcc_diag_char_table, gcc_tdiag_char_table, gcc_cdiag_char_table, gcc_cxxdiag_char_table): Add %r and %R format specifiers. cp/ * error.c (cp_print_error_function, print_instantiation_partial_context_line, maybe_print_constexpr_context): Colorize locus strings. From-SVN: r197841
2013-04-11fix changelogJason Merrill1-0/+2
From-SVN: r197827
2013-04-11re PR c++/52748 ([C++11] N3276 changes to decltype)Jason Merrill5-26/+65
PR c++/52748 * parser.c (complain_flags): New. (cp_parser_postfix_expression): Use it. (cp_parser_unary_expression): Likewise. (cp_parser_binary_expression): Likewise. (cp_parser_assignment_expression): Likewise. (cp_parser_expression): Likewise. (cp_parser_postfix_open_square_expression): Take decltype_p. (cp_parser_builtin_offsetof): Adjust. (cp_convert_range_for): Pass complain to finish_unary_op_expr. * semantics.c (finish_unary_op_expr): Add complain parm. From-SVN: r197826
2013-04-11re PR c++/56895 (ICE: unexpected expression of kind arrow_expr)Jakub Jelinek2-1/+7
PR c++/56895 * call.c (null_ptr_cst_p): Call fold_non_dependent_expr_sfinae before calling maybe_constant_value for C++98. * g++.dg/template/arrow4.C: New test. From-SVN: r197824
2013-04-11re PR c++/56901 (lambda with implicit capture by reference)Jason Merrill2-5/+9
PR c++/56901 * semantics.c (lambda_capture_field_type, lambda_proxy_type): Strip references before checking WILDCARD_TYPE_P. From-SVN: r197819
2013-04-11call.c (build_conditional_expr_1, [...]): Protect error calls with complain ↵Paolo Carlini4-46/+86
& tf_error. 2013-04-11 Paolo Carlini <paolo.carlini@oracle.com> * call.c (build_conditional_expr_1, build_over_call): Protect error calls with complain & tf_error. * typeck.c (finish_class_member_access_expr, cp_build_binary_op, build_x_unary_op, cp_build_unary_op, cp_build_compound_expr, build_ptrmemfunc): Likewise. (lookup_destructor): Take tsubst_flags_t parameter, adjust. * cvt.c (warn_ref_binding): Rename to diagnose_ref_binding. (convert_to_reference): Adjust. From-SVN: r197813
2013-04-11pt.c (tsubst_copy): Don't call tsubst for local variables, look them up instead.Jason Merrill2-34/+38
* pt.c (tsubst_copy) [VAR_DECL]: Don't call tsubst for local variables, look them up instead. (tsubst_decl) [VAR_DECL]: Remove handling for anonymous union proxies and substitution in unevaluated context. (tsubst_expr) [OMP_FOR]: Instantiate OMP_FOR_PRE_BODY before the iterators. From-SVN: r197811
2013-04-11re PR c++/23055 (overload resolution does not find templated function (zero ↵Jason Merrill2-1/+149
-> pointer)) PR c++/23055 * pt.c (uses_deducible_template_parms): New. (deducible_array_bound, deducible_expression): New. (deducible_template_args): New. (unify_one_argument): Call uses_deducible_template_parms. From-SVN: r197790
2013-04-11re PR c++/56913 ([C++11] SFINAE for ill-formed pointer-to-member operators ↵Paolo Carlini2-4/+18
with incompatible ref-qualifiers) /cp 2013-04-11 Paolo Carlini <paolo.carlini@oracle.com> PR c++/56913 * typeck2.c (build_m_component_ref): Protect error calls with (complain & tf_error). /testsuite 2013-04-11 Paolo Carlini <paolo.carlini@oracle.com> PR c++/56913 * g++.dg/cpp0x/sfinae44.C: New. From-SVN: r197780
2013-04-11re PR c++/54216 (Missing diagnostic for ill-formed anonymous enum declarations)Paolo Carlini2-1/+16
/cp 2013-04-11 Paolo Carlini <paolo.carlini@oracle.com> PR c++/54216 * parser.c (cp_parser_enum_specifier): Check for empty anonymous enums and anonymous scoped enums. /testsuite 2013-04-11 Paolo Carlini <paolo.carlini@oracle.com> PR c++/54216 * g++.dg/cpp0x/enum26.C: New. * g++.old-deja/g++.pt/mangle1.C: Adjust. From-SVN: r197742
2013-04-10re PR c++/56895 (ICE: unexpected expression of kind arrow_expr)Jakub Jelinek2-4/+18
PR c++/56895 * typeck.c (cp_build_binary_op): Call fold_non_dependent_expr_sfinae first before calling maybe_constant_value for warn_for_div_by_zero or invalid shift count warning purposes. * g++.dg/template/arrow3.C: New test. From-SVN: r197660
2013-04-09re PR c++/25466 (typeid expression fails to throw bad_typeid according to ↵Jason Merrill2-7/+11
5.2.8p2) PR c++/25466 * rtti.c (build_typeid): Check the address of the argument rather than looking for an INDIRECT_REF. From-SVN: r197644
2013-04-08re PR c++/56838 (GCC svn doesn't compile libreoffice 4.0.1.2)Jason Merrill2-0/+11
PR c++/56838 PR c++/17232 * typeck2.c (abstract_virtuals_error_sfinae): Disable complete_type again. From-SVN: r197613
2013-04-08re PR c++/56871 ([c++11] Specialization of constexpr Templated Function)Paolo Carlini2-5/+20
/cp 2013-04-08 Paolo Carlini <paolo.carlini@oracle.com> PR c++/56871 * decl.c (validate_constexpr_redeclaration): Allow an explicit specialization to be different wrt the constexpr specifier. /testsuite 2013-04-08 Paolo Carlini <paolo.carlini@oracle.com> PR c++/56871 * g++.dg/cpp0x/constexpr-specialization.C: New. From-SVN: r197597
2013-04-07parser.c (cp_parser_std_attribute): Treat [[noreturn]] like GNU noreturn ↵Jason Merrill2-2/+12
attribute. * parser.c (cp_parser_std_attribute): Treat [[noreturn]] like GNU noreturn attribute. From-SVN: r197555
2013-04-05There can be only one ref qualifier at most.Ed Smith-Rowland2-15/+41
gcc/cp: 2013-04-05 Ed Smith-Rowland <3dw4rd@verizon.net> * g++.dg/cpp0x/ref-qual-multi-neg.C: New test. gcc/testsuite: 2013-04-05 Ed Smith-Rowland <3dw4rd@verizon.net> * parser.c (cp_parser_ref_qualifier_seq_opt): Move to cp_parser_ref_qualifier_opt. Error if more than one ref-qual found. From-SVN: r197514
2013-04-03cp-tree.h (FUNCTION_OR_METHOD_TYPE_CHECK): Remove.Jason Merrill2-6/+7
* cp-tree.h (FUNCTION_OR_METHOD_TYPE_CHECK): Remove. (TYPE_RAISES_EXCEPTIONS): Use FUNC_OR_METHOD_CHECK instead. (FUNCTION_REF_QUALIFIED, FUNCTION_RVALUE_QUALIFIED): Likewise. From-SVN: r197466
2013-04-03cp-demangle.c (cplus_demangle_type): Fix function quals.Jason Merrill2-2/+16
libiberty/ * cp-demangle.c (cplus_demangle_type): Fix function quals. (d_pointer_to_member_type): Simplify. gcc/cp/ * mangle.c (write_type): When writing a function type with function-cv-quals, don't add the unqualified type as a substitution candidate. From-SVN: r197460
2013-04-03re PR c++/56815 (void pointer arithmetic)Paolo Carlini2-6/+13
/cp 2013-04-03 Paolo Carlini <paolo.carlini@oracle.com> PR c++/56815 * typeck.c (cp_build_unary_op): Change -Wpointer-arith permerror to pedwarn. /testsuite 2013-04-03 Paolo Carlini <paolo.carlini@oracle.com> PR c++/56815 * g++.dg/warn/Wpointer-arith-1.C: New. * g++.dg/gomp/for-19.C: Adjust. From-SVN: r197433