1. 25 Jul, 2018 2 commits
    • cp-tree.h (enum cp_tree_index): Add… · cf7fb52d
      cp-tree.h (enum cp_tree_index): Add CPTI_{ABI_TAG,ALIGNED,BEGIN,END,GET,TUPLE_{ELEMENT,SIZE}}_IDENTIFIER and...
      
      	* cp-tree.h (enum cp_tree_index): Add
      	CPTI_{ABI_TAG,ALIGNED,BEGIN,END,GET,TUPLE_{ELEMENT,SIZE}}_IDENTIFIER
      	and CPTI_{GNU,TYPE,VALUE,FUN,CLOSURE}_IDENTIFIER.
      	(abi_tag_identifier, aligned_identifier, begin_identifier,
      	end_identifier, get__identifier, gnu_identifier,
      	tuple_element_identifier, tuple_size_identifier, type_identifier,
      	value_identifier, fun_identifier, closure_identifier): Define.
      	* decl.c (initialize_predefined_identifiers): Initialize the above
      	identifiers.
      	(get_tuple_size): Use tuple_size_identifier instead of
      	get_identifier ("tuple_size") and value_identifier instead of
      	get_identifier ("value").
      	(get_tuple_element_type): Use tuple_element_identifier instead of
      	get_identifier ("tuple_element") and type_identifier instead of
      	get_identifier ("type").
      	(get_tuple_decomp_init): Use get__identifier instead of
      	get_identifier ("get").
      	* lambda.c (maybe_add_lambda_conv_op): Use fun_identifier instead of
      	get_identifier ("_FUN").
      	* parser.c (cp_parser_lambda_declarator_opt): Use closure_identifier
      	instead of get_identifier ("__closure").
      	(cp_parser_std_attribute): Use gnu_identifier instead of
      	get_identifier ("gnu").
      	(cp_parser_std_attribute_spec): Likewise.  Use aligned_identifier
      	instead of get_identifier ("aligned").
      	* class.c (check_abi_tags, inherit_targ_abi_tags): Use
      	abi_tag_identifier instead of get_identifier ("abi_tag").
      
      From-SVN: r262976
      Jakub Jelinek committed
    • re PR c++/85515 (Bogus suggestions from "GCC's leaky abstractions") · 213f5e8a
      	PR c++/85515
      	* cp-tree.h (enum cp_tree_index): Add
      	CPTI_FOR_{RANGE,BEGIN,END}{,_}_IDENTIFIER.
      	(for_range__identifier, for_begin__identifier, for_end__identifier,
      	for_range_identifier, for_begin_identifier, for_end_identifier):
      	Define.
      	* decl.c (initialize_predefined_identifiers): Initialize
      	for_{range,begin,end}{,_}_identifier.
      	* parser.c (build_range_temp): Use for_range__identifier instead of
      	get_identifier ("__for_range").
      	(cp_convert_range_for): Use for_begin__identifier and
      	for_end__identifier instead of get_identifier ("__for_begin") and
      	get_identifier ("__for_end").
      	* semantics.c (finish_for_stmt): Rename "__for_{range,begin,end} "
      	local symbols to "__for_{range,begin,end}".
      
      	* g++.dg/pr85515-2.C: Add expected dg-error.
      	* g++.dg/cpp0x/range-for36.C: New test.
      
      From-SVN: r262975
      Jakub Jelinek committed
  2. 23 Jul, 2018 1 commit
  3. 19 Jul, 2018 1 commit
    • revert: [multiple changes] · 0d214821
      2018-07-19  Paolo Carlini  <paolo.carlini@oracle.com>
      
      	Revert fix for c++/59480 (and testsuite followup)
      
      	/testsuite
      	2018-07-19  Paolo Carlini  <paolo.carlini@oracle.com>
      
      	* g++.old-deja/g++.mike/p784.C: Add -fpermissive.
      
      	/cp
      	2019-07-18  Paolo Carlini  <paolo.carlini@oracle.com>
      
      	PR c++/59480, DR 136
      	* decl.c (check_no_redeclaration_friend_default_args): New.
      	(duplicate_decls): Use the latter; also check that a friend
      	declaration specifying default arguments is a definition.
      
      	/testsuite
      	2019-07-18  Paolo Carlini  <paolo.carlini@oracle.com>
      
      	PR c++/59480, DR 136
      	* g++.dg/other/friend8.C: New.
      	* g++.dg/other/friend9.C: Likewise.
      	* g++.dg/other/friend10.C: Likewise.
      	* g++.dg/other/friend11.C: Likewise.
      	* g++.dg/other/friend12.C: Likewise.
      	* g++.dg/parse/defarg4.C: Compile with -fpermissive -w.
      	* g++.dg/parse/defarg8.C: Likewise.
      
      From-SVN: r262883
      Paolo Carlini committed
  4. 18 Jul, 2018 5 commits
    • re PR c++/86550 (Lambda parsing allows arbitrary types in decl-specifier-seq) · a171a8bb
      	PR c++/86550
      	* parser.c (cp_parser_decl_specifier_seq): Diagnose invalid type
      	specifier if CP_PARSER_FLAGS_ONLY_MUTABLE_OR_CONSTEXPR.
      
      	* g++.dg/cpp0x/lambda/lambda-86550.C: New test.
      
      From-SVN: r262862
      Jakub Jelinek committed
    • PR c++/86190 - bogus -Wsign-conversion warning · c56e9727
      	PR c++/86190 - bogus -Wsign-conversion warning
      	* typeck.c (cp_build_binary_op): Fix formatting.  Add a warning
      	sentinel.
      
      	* g++.dg/warn/Wsign-conversion-3.C: New test.
      	* g++.dg/warn/Wsign-conversion-4.C: New test.
      
      From-SVN: r262855
      Marek Polacek committed
    • 2018-07-18 Paolo Carlini <paolo.carlini@oracle.com> · 02920765
      	* Fix typos in ChangeLog entries.
      
      From-SVN: r262852
      Paolo Carlini committed
    • re PR c++/59480 (Missing error diagnostic: friend declaration specifying a… · 6498dea6
      re PR c++/59480 (Missing error diagnostic: friend declaration specifying a default argument must be a definition)
      
      /cp
      2018-07-18  Paolo Carlini  <paolo.carlini@oracle.com>
      
      	* class.c (note_name_declared_in_class): Prefer permerror + inform
      	to a pair of permerrors; use DECL_SOURCE_LOCATION.
      
      /testsuite
      2018-07-18  Paolo Carlini  <paolo.carlini@oracle.com>
      
      	* g++.dg/ext/uow-3.C: Adjust.
      	* g++.dg/ext/uow-4.C: Likewise.
      	* g++.dg/lookup/name-clash11.C: Likewise.
      	* g++.dg/lookup/name-clash7.C: Likewise.
      	* g++.dg/lookup/redecl1.C: Likewise.
      	* g++.dg/warn/changes-meaning.C: Likewise.
      	* g++.old-deja/g++.jason/scoping8.C: Likewise.
      	* g++.old-deja/g++.law/nest1.C: Likewise.
      
      /cp
      2019-07-18  Paolo Carlini  <paolo.carlini@oracle.com>
      
      	PR c++/59480, DR 136
      	* decl.c (check_no_redeclaration_friend_default_args): New.
      	(duplicate_decls): Use the latter; also check that a friend
      	declaration specifying default arguments is a definition.
      
      /testsuite
      2019-07-18  Paolo Carlini  <paolo.carlini@oracle.com>
      
      	PR c++/59480, DR 136
      	* g++.dg/other/friend8.C: New.
      	* g++.dg/other/friend9.C: Likewise.
      	* g++.dg/other/friend10.C: Likewise.
      	* g++.dg/other/friend11.C: Likewise.
      	* g++.dg/other/friend12.C: Likewise.
      	* g++.dg/parse/defarg4.C: Compile with -fpermissive -w.
      	* g++.dg/parse/defarg8.C: Likewise.
      
      From-SVN: r262851
      Paolo Carlini committed
    • re PR debug/86523 (ICE in gen_member_die, at dwarf2out.c:24933 starting from r262560) · 97f13235
      2018-07-18  Richard Biener  <rguenther@suse.de>
      
      	PR debug/86523
      	cp/
      	* decl2.c (c_parse_final_cleanups): Call write_out_vars before
      	start_static_storage_duration_function sets current_function_decl.
      
      	* g++.dg/lto/pr86523-3_0.C: New testcase.
      
      From-SVN: r262849
      Richard Biener committed
  5. 17 Jul, 2018 1 commit
  6. 16 Jul, 2018 2 commits
  7. 13 Jul, 2018 1 commit
  8. 12 Jul, 2018 1 commit
    • c-attribs.c (c_common_attribute_table): Add "omp declare target implicit" attribute. · 9b452033
      	* c-attribs.c (c_common_attribute_table): Add
      	"omp declare target implicit" attribute.
      
      	* c-decl.c (c_decl_attributes): Don't diagnose vars without mappable
      	type here, instead add "omp declare target implicit" attribute.
      	(finish_decl): Diagnose vars without mappable type here.
      
      	* decl2.c (cplus_decl_attributes): Don't diagnose vars without mappable
      	type here, instead add "omp declare target implicit" attribute.  Add
      	that attribute instead of "omp declare target" also when
      	processing_template_decl.
      	* decl.c (cp_finish_decl): Diagnose vars without mappable type here,
      	and before calling cp_omp_mappable_type call complete_type.
      
      	* c-c++-common/gomp/declare-target-3.c: New test.
      	* g++.dg/gomp/declare-target-2.C: New test.
      
      From-SVN: r262605
      Jakub Jelinek committed
  9. 10 Jul, 2018 2 commits
    • re PR sanitizer/86406 ([UBSAN] -fcompare-debug failure with -fsanitize=undefined) · f1bc6cae
      	PR sanitizer/86406
      	* cp-gimplify.c (cp_maybe_instrument_return): Skip trailing
      	DEBUG_BEGIN_STMTs.
      
      	* g++.dg/ubsan/pr86406.C: New test.
      
      From-SVN: r262536
      Jakub Jelinek committed
    • re PR c++/86443 (ICEs on #pragma omp distribute parallel for with class iterators) · 0b27c3ed
      	PR c++/86443
      	* gimplify.c (find_combined_omp_for): Add DATA argument, in addition
      	to finding the inner OMP_FOR/OMP_SIMD stmt find non-trivial wrappers,
      	BLOCKs with BLOCK_VARs, OMP_PARALLEL in between, OMP_FOR in between.
      	(gimplify_omp_for): For composite loops, move outer
      	OMP_{DISTRIBUTE,TASKLOOP,FOR,PARALLEL} right around innermost
      	OMP_FOR/OMP_SIMD if there are any non-trivial wrappers.  For class
      	iterators add any needed clauses.  Allow OMP_FOR_ORIG_DECLS to contain
      	TREE_LIST for both the original class iterator and the "last" helper
      	var.  Gimplify OMP_FOR_PRE_BODY before the outermost composite
      	loop, remember has_decl_expr from outer composite loops for the
      	innermost OMP_SIMD in TREE_PRIVATE bit on OMP_FOR_INIT.
      gcc/c-family/
      	* c-omp.c (c_omp_check_loop_iv_r, c_omp_check_loop_iv): Allow declv
      	to contain TREE_LIST for both the original class iterator and the
      	"last" helper var.
      gcc/cp/
      	* semantics.c (handle_omp_for_class_iterator): Remove lastp argument,
      	instead of setting *lastp turn orig_declv elt into a TREE_LIST.
      	(finish_omp_for): Adjust handle_omp_for_class_iterator caller.
      	* pt.c (tsubst_omp_for_iterator): Allow OMP_FOR_ORIG_DECLS to contain
      	TREE_LIST for both the original class iterator and the "last" helper
      	var.
      libgomp/
      	* testsuite/libgomp.c++/for-15.C: New test.
      
      From-SVN: r262534
      Jakub Jelinek committed
  10. 09 Jul, 2018 1 commit
    • decl.c (grokdeclarator): Use rich_location::add_range in three more places;… · 7b3bc054
      decl.c (grokdeclarator): Use rich_location::add_range in three more places; include gcc-rich-location.h.
      
      /cp
      2018-07-09  Paolo Carlini  <paolo.carlini@oracle.com>
      
      	* decl.c (grokdeclarator): Use rich_location::add_range in three
      	more places; include gcc-rich-location.h.
      
      /testsuite
      2018-07-09  Paolo Carlini  <paolo.carlini@oracle.com>
      
      	* g++.dg/diagnostic/long-short.C: New.
      	* g++.dg/diagnostic/signed-unsigned.C: Likewise.
      	* g++.dg/diagnostic/virtual-friend.C: Likewise.
      	* g++.old-deja/g++.brendan/crash11.C: Adjust.
      
      From-SVN: r262512
      Paolo Carlini committed
  11. 07 Jul, 2018 1 commit
    • tree-vrp.c (vrp_int_const_binop): Change overflow type to overflow_type. · 4a669ac3
      	* tree-vrp.c (vrp_int_const_binop): Change overflow type to
      	overflow_type.
      	(combine_bound): Use wide-int overflow calculation instead of
      	rolling our own.
      	* calls.c (maybe_warn_alloc_args_overflow): Change overflow type to
      	overflow_type.
      	* fold-const.c (int_const_binop_2): Same.
      	(extract_muldiv_1): Same.
      	(fold_div_compare): Same.
      	(fold_abs_const): Same.
      	* match.pd: Same.
      	* poly-int.h (add): Same.
      	(sub): Same.
      	(neg): Same.
      	(mul): Same.
      	* predict.c (predict_iv_comparison): Same.
      	* profile-count.c (slow_safe_scale_64bit): Same.
      	* simplify-rtx.c (simplify_const_binary_operation): Same.
      	* tree-chrec.c (tree_fold_binomial): Same.
      	* tree-data-ref.c (split_constant_offset_1): Same.
      	* tree-if-conv.c (idx_within_array_bound): Same.
      	* tree-scalar-evolution.c (iv_can_overflow_p): Same.
      	* tree-ssa-phiopt.c (minmax_replacement): Same.
      	* tree-vect-loop.c (is_nonwrapping_integer_induction): Same.
      	* tree-vect-stmts.c (vect_truncate_gather_scatter_offset): Same.
      	* vr-values.c (vr_values::adjust_range_with_scev): Same.
      	* wide-int.cc (wi::add_large): Same.
      	(wi::mul_internal): Same.
      	(wi::sub_large): Same.
      	(wi::divmod_internal): Same.
      	* wide-int.h: Change overflow type to overflow_type for neg, add,
      	mul, smul, umul, div_trunc, div_floor, div_ceil, div_round,
      	mod_trunc, mod_ceil, mod_round, add_large, sub_large,
      	mul_internal, divmod_internal.
      	(overflow_type): New enum.
      	(accumulate_overflow): New.
      
      cp/
      	* decl.c (build_enumerator): Change overflow type to overflow_type.
      	* init.c (build_new_1): Same.
      
      From-SVN: r262494
      Aldy Hernandez committed
  12. 05 Jul, 2018 1 commit
    • Replace NO_IMPLICIT_EXTERN_C with SYSTEM_IMPLICIT_EXTERN_C. · 09cff37b
      	gcc/
      	Replace NO_IMPLICIT_EXTERN_C with SYSTEM_IMPLICIT_EXTERN_C.
      	* doc/cpp.texi: Update comment.
      	* doc/tm.texi: Rebuilt.
      	* doc/tm.texi.in (NO_IMPLICIT_EXTERN_C): Replace with ...
      	(SYSTEM_IMPLICIT_EXTERN_C): ... this, opposite sense.
      	* doc/extend.texi (Backwards Compatibility): Clarify it is system
      	headers affected by extern "C".
      	* system.h: Poison NO_IMPLICIT_EXTERN_C.
      	* config/alpha/alpha.h, config/arm/uclinux-elf.h,
      	config/bfin/elf.h, config/cris/cris.h, config/darwin.h,
      	config/dragonfly.h, config/freebsd.h, config/gnu-user.h,
      	config/i386/cygming.h, config/i386/djgpp.h, config/i386/nto.h,
      	config/ia64/hpux.h, config/lm32/lm32.h, config/lm32/uclinux-elf.h,
      	config/lynx.h, config/mips/elf.h, config/mmix/mmix.h,
      	config/netbsd.h, config/pa/pa-hpux.h, config/powerpcspe/sysv4.h,
      	config/riscv/elf.h, config/rs6000/sysv4.h, config/rtems.h,
      	config/s390/tpf.h, config/sh/newlib.h, config/sol2.h,
      	config/sparc/openbsd64.h, config/sparc/sp-elf.h,
      	config/sparc/sp64-elf.h, config/spu/spu.h,
      	config/stormy16/stormy16.h, config/v850/v850.h,
      	config/visium/visium.h, config/vx-common.h, config/xtensa/elf.h: Don't
      	define NO_IMPLICIT_EXTERN_C.
      	* config/rs6000/aix.h: Set SYSTEM_IMPLICIT_EXTERN_C.
      
      	gcc/c-family/
      	* c-lex.c (fe_file_change): Check SYSTEM_IMPLICIT_EXTERN_C not
      	NO_IMPLICIT_EXTERN_C.
      
      	gcc/cp/
      	* cp/decl.c (decls_match): Check SYSTEM_IMPLICIT_EXTERN_C not
      	NO_IMPLICIT_EXTERN_C.
      	* cp/parser.c (cp_parser_parameter_declaration_clause): Likewise.
      
      From-SVN: r262437
      Nathan Sidwell committed
  13. 04 Jul, 2018 1 commit
  14. 03 Jul, 2018 3 commits
    • decl.c (min_location): New. · 2dac4037
      /cp
      2018-07-03  Paolo Carlini  <paolo.carlini@oracle.com>
      
      	* decl.c (min_location): New.
      	(smallest_type_quals_location): Use the latter.
      	(check_concept_fn): Use DECL_SOURCE_LOCATION.
      	(grokdeclarator): Use accurate locations in a number of error
      	messages involving ds_thread, ds_storage_class, ds_virtual,
      	ds_constexpr, ds_typedef and ds_friend; exploit min_location.
      
      /testsuite
      2018-07-03  Paolo Carlini  <paolo.carlini@oracle.com>
      
      	* g++.dg/other/locations1.C: New.
      	* g++.dg/tls/locations1.C: Likewise.
      	* g++.dg/diagnostic/virtual-constexpr.C: Likewise.
      	* g++.dg/diagnostic/virtual-static.C: Likewise.
      	* g++.dg/concepts/fn-concept2.C: Test the locations too.
      	* g++.dg/cpp0x/constexpr-virtual5.C: Likewise.
      	* g++.dg/cpp0x/pr51463.C: Likewise.
      	* g++.dg/other/typedef1.C: Likewise.
      	* g++.dg/parse/dtor13.C: Likewise.
      	* g++.dg/template/error44.C: Likewise.
      	* g++.dg/template/typedef4.C: Likewise.
      	* g++.dg/template/typedef5.C: Likewise.
      	* g++.dg/tls/diag-2.C: Likewise.
      	* g++.old-deja/g++.brendan/crash11.C: Likewise.
      
      From-SVN: r262358
      Paolo Carlini committed
    • re PR c++/86201 (ICE: Error reporting routines re-entered) · 44b0c9ae
      	PR c++/86201
      	* typeck.c (cp_build_binary_op): Check c_inhibit_evaluation_warnings.
      
      	* g++.dg/diagnostic/pr86201.C: New test.
      
      From-SVN: r262353
      Marek Polacek committed
    • PR c++/86378 - functional cast in noexcept-specifier. · 2831d681
      	* tree.c (strip_typedefs_expr) [TREE_LIST]: Fix iteration.
      
      From-SVN: r262343
      Jason Merrill committed
  15. 02 Jul, 2018 1 commit
    • parser.c (set_and_check_decl_spec_loc): Use rich_location::add_range in error… · a5eae716
      parser.c (set_and_check_decl_spec_loc): Use rich_location::add_range in error message about __thread and thread_local...
      
      /cp
      2018-07-02  Paolo Carlini  <paolo.carlini@oracle.com>
      
      	* parser.c (set_and_check_decl_spec_loc): Use rich_location::add_range
      	in error message about __thread and thread_local at the same time.
      
      /testsuite
      2018-07-02  Paolo Carlini  <paolo.carlini@oracle.com>
      
      	* g++.dg/diagnostic/thread-thread_local.C: New.
      
      From-SVN: r262321
      Paolo Carlini committed
  16. 29 Jun, 2018 1 commit
  17. 28 Jun, 2018 2 commits
  18. 27 Jun, 2018 4 commits
    • C++: don't offer bogus "._0" suggestions (PR c++/86329) · 5da1234b
      PR c++/86329 reports that the C++ frontend can offer bogus suggestions like:
      
      #include <string>
      
      int compare()
      {
        return __n1 - __n2;
      }
      
      suggested.cc: In function 'int compare()':
      suggested.cc:5:10: error: '__n1' was not declared in this scope
         return __n1 - __n2;
                ^~~~
      suggested.cc:5:10: note: suggested alternative: '._61'
         return __n1 - __n2;
                ^~~~
                ._61
      suggested.cc:5:17: error: '__n2' was not declared in this scope
         return __n1 - __n2;
                       ^~~~
      suggested.cc:5:17: note: suggested alternative: '._72'
         return __n1 - __n2;
                       ^~~~
                       ._72
      
      The dot-prefixed names are an implementation detail of how we implement
      anonymous enums found in the header files, generated via
      anon_aggrname_format in make_anon_name.
      
      This patch uses anon_aggrname_p to filter them out when considering
      which names to suggest.
      
      gcc/cp/ChangeLog:
      	PR c++/86329
      	* name-lookup.c (consider_binding_level): Filter out names that
      	match anon_aggrname_p.
      
      gcc/testsuite/ChangeLog:
      	PR c++/86329
      	* g++.dg/lookup/pr86329.C: New test.
      
      From-SVN: r262199
      David Malcolm committed
    • Avoid crash on friend in nested class template. · 8945521a
      	* name-lookup.c (do_pushtag): If we skip a class level, also skip
      	its template level.
      
      From-SVN: r262188
      Jason Merrill committed
    • PR c++/86320 - memory-hog with std::array of pair · 307193b8
      	* typeck2.c (process_init_constructor_array): Only compute a
      	constant initializer once.
      
      In this PR, we have a large std::array of pairs.  Since the C array is
      wrapped in a class we don't go to build_vec_init, so we end up with
      digest_init wanting to build up the element initializer for each element of
      the array.
      
      In the more general case, like 80272, we have a data structure problem: we
      don't currently have a good way of expressing the same dynamic
      initialization of many elements within a CONSTRUCTOR.  RANGE_EXPR probably
      ought to work, but will need more work at genericize or gimplify time.
      
      But in this case, the initialization for each element reduces to constant
      0, so we don't even need to add anything to the CONSTRUCTOR.  We just need
      to realize that if the initializer for one element is 0, the others will be
      as well, and we don't need to iterate over the whole array.
      
      For the trunk, I also use a RANGE_EXPR to handle constant initialization by
      a value other than 0.
      
      void foo ()
      {
        std::array<std::pair<int, int>, 1024 * 1024> arr {};
      }
      
      From-SVN: r262173
      Jason Merrill committed
    • PR c++/80290 - memory-hog with std::pair. · 6147a53a
      	* pt.c (fn_type_unification): Add convs parameter.
      	(check_non_deducible_conversion): Remember conversion.
      	(check_non_deducible_conversions): New.  Do checks here.
      	(type_unification_real): Not here.  Remove flags parm.
      	* call.c (add_function_candidate): Make convs a parameter.
      	Don't recalculate the conversion if it's already set.
      	(add_template_candidate_real): Allocate convs here.
      	(good_conversion, conv_flags): New.
      
      When the std::pair constructors got more complex to handle, it aggravated a
      preexisting algorithmic problem in template overload resolution:
      
      As part of template argument deduction in a call, once we've deduced all
      the template arguments we can but before we substitute them to form an
      actual declaration, for any function parameters that don't involve template
      parameters we need to check that it's possible to convert the argument to
      the parameter type (wg21.link/cwg1391).
      
      As a result, we end up calculating the conversion twice: once here, and
      then again in add_function_candidate as part of normal overload resolution.
      Normally this isn't a big deal, but when the argument is a multiply-nested
      initializer list, doubling the conversion processing at each level leads to
      combinatorial explosion.
      
      The patch for trunk avoids the duplication by remembering the conversion we
      calculate at deduction time and then reusing it in overload resolution
      rather than calculating it again.
      
      From-SVN: r262172
      Jason Merrill committed
  19. 26 Jun, 2018 1 commit
  20. 25 Jun, 2018 1 commit
    • C++: Fix PR86082 · 4f1c88ae
      When turning a user-defined numerical literal into an operator
      invocation the literal needs to be translated to the execution
      character set.
      
      gcc/cp/ChangeLog:
      
      2018-06-25  Andreas Krebbel  <krebbel@linux.ibm.com>
      
      	PR C++/86082
      	* parser.c (make_char_string_pack): Pass this literal chars
      	through cpp_interpret_string.
      	(cp_parser_userdef_numeric_literal): Check the result of
      	make_char_string_pack.
      
      gcc/testsuite/ChangeLog:
      
      2018-06-25  Andreas Krebbel  <krebbel@linux.ibm.com>
      
      	PR C++/86082
      	* g++.dg/pr86082.C: New test.
      
      From-SVN: r262003
      Andreas Krebbel committed
  21. 23 Jun, 2018 1 commit
    • decl.c (bad_specifiers): Add const location_t* parameter and use locations in… · be68f3fa
      decl.c (bad_specifiers): Add const location_t* parameter and use locations in error messages about...
      
      /cp
      2018-06-23  Paolo Carlini  <paolo.carlini@oracle.com>
      
      	* decl.c (bad_specifiers): Add const location_t* parameter and
      	use locations in error messages about 'inline' and 'virtual'.
      	(mark_inline_variable): Add location_t parameter and use it in
      	error_at and pedwarn messages.
      	(grokdeclarator): Use declspecs->locations[ds_constexpr],
      	declspecs->locations[ds_concept], declspecs->locations[ds_virtual],
      	declspecs->locations[ds_inline] in many error messages; adjust
      	bad_specifiers and mark_inline_variable calls.
      	(grokvardecl): Use declspecs->locations[ds_concept] in error message.
      
      /testsuite
      2018-06-23  Paolo Carlini  <paolo.carlini@oracle.com>
      
      	* g++.dg/concepts/locations1.C: New.
      	* g++.dg/cpp0x/locations1.C: Likewise.
      	* g++.dg/cpp1z/inline-var2.C: Test locations too.
      	* g++.dg/cpp1z/inline-var3.C: Likewise.
      
      From-SVN: r261982
      Paolo Carlini committed
  22. 22 Jun, 2018 2 commits
    • PR c++/86219 - ICE with erroneous initializer in template. · e56f6629
      	* constexpr.c (fold_non_dependent_expr): Add complain parm.
      	* call.c, expr.c, init.c, pt.c, semantics.c, typeck.c, typeck2.c:
      	Pass it.
      	* call.c (build_cxx_call): Don't mess with builtins in a template.
      	* typeck2.c (store_init_value): If fold_non_dependent_expr didn't
      	produce a constant value, go back to the uninstantiated form.
      
      From-SVN: r261972
      Jason Merrill committed
    • Avoid taking the address of something just because it's in parens. · e4511ca2
      	* constexpr.c (same_type_ignoring_tlq_and_bounds_p): New.
      	(cxx_fold_indirect_ref): Use it.
      	(cxx_eval_constant_expression) [VIEW_CONVERT_EXPR]: Use it.
      	* cp-tree.h (REF_PARENTHESIZED_P): Allow VIEW_CONVERT_EXPR.
      	* semantics.c (force_paren_expr): Use VIEW_CONVERT_EXPR instead of
      	static_cast to reference type.
      	(maybe_undo_parenthesized_ref): Handle VIEW_CONVERT_EXPR.
      
      From-SVN: r261971
      Jason Merrill committed
  23. 21 Jun, 2018 4 commits