Commit Graph

108 Commits

Author SHA1 Message Date
Jakub Jelinek
d81efb065d Update ChangeLog and version files for release 2021-04-27 09:23:56 +00:00
GCC Administrator
651b8a50a6 Daily bump. 2021-01-06 00:16:55 +00:00
Samuel Thibault
f56de3557f Update GNU/Hurd configure support
ChangeLog:

	* libtool.m4: Match gnu* along other GNU systems.
	* libgo/config/libtool.m4: Match gnu* along other GNU systems.
	* libgo/configure: Re-generate.

libffi/
	* configure: Re-generate.

libgomp/
	* configure: Re-generate.

gcc/

	* configure: Re-generate.

libatomic/

	* configure: Re-generate.

libbacktrace/

	* configure: Re-generate.

libcc1/

	* configure: Re-generate.

libgfortran/

	* configure: Re-generate.

libgomp/

	* configure: Re-generate.

libhsail-rt/

	* configure: Re-generate.

libitm/

	* configure: Re-generate.

libobjc/

	* configure: Re-generate.

liboffloadmic/

	* configure: Re-generate.
	* plugin/configure: Re-generate.

libphobos/

	* configure: Re-generate.

libquadmath/

	* configure: Re-generate.

libsanitizer/

	* configure: Re-generate.

libssp/

	* configure: Re-generate.

libstdc++-v3/

	* configure: Re-generate.

libvtv/

	* configure: Re-generate.

lto-plugin/

	* configure: Re-generate.

zlib/

	* configure: Re-generate.
2021-01-05 16:04:14 -07:00
Jakub Jelinek
99dee82307 Update copyright years. 2021-01-04 10:26:59 +01:00
GCC Administrator
b1a2242e24 Daily bump. 2020-12-19 00:16:31 +00:00
Jakub Jelinek
5dc998933e libcc1: Fix up libcc1 configure [PR98330]
Either we should write test x$darwin_dynamic_lookup = xyes
or we should make sure the variable is always defined to non-empty string.

2020-12-18  Jakub Jelinek  <jakub@redhat.com>

	PR bootstrap/98380
	* configure.ac: Set darwin_dynamic_lookup=no instead to empty
	string.
	* configure: Regenerated.
2020-12-18 20:25:26 +01:00
GCC Administrator
6e1edf48eb Daily bump. 2020-12-06 00:16:44 +00:00
Iain Sandoe
1352bc88a0 Darwin : Update libtool and dependencies for Darwin20 [PR97865]
The change in major version (and the increment from Darwin19 to 20)
caused libtool tests to fail which resulted in incorrect build settings
for shared libraries.

We take this opportunity to sort out the shared undefined symbols state
rather than propagating the current unsound behaviour into a new rev.

This change means that we default to the case that missing symbols are
considered an error, and if one wants to allow this intentionally, the
confiuration for that case should be set appropriately.

Three existing cases need undefined dynamic lookup:
 libitm, where there is already a configuration mechanism to add the
         flags.
 libcc1, where we add simple configuration to add the flags for Darwin.
 libsanitizer, where we can add to the existing extra flags.

libcc1/ChangeLog:

	PR target/97865
	* Makefile.am: Add dynamic_lookup to LD flags for Darwin.
	* configure.ac: Test for Darwin host and set a flag.
	* Makefile.in: Regenerate.
	* configure: Regenerate.

libitm/ChangeLog:

	PR target/97865
	* configure.tgt: Add dynamic_lookup to XLDFLAGS for Darwin.
	* configure: Regenerate.

libsanitizer/ChangeLog:

	PR target/97865
	* configure.tgt: Add dynamic_lookup to EXTRA_CXXFLAGS for
	Darwin.
	* configure: Regenerate.

ChangeLog:

	PR target/97865
	* libtool.m4: Update handling of Darwin platform link flags
	for Darwin20.

gcc/ChangeLog:

	PR target/97865
	* configure: Regenerate.

libatomic/ChangeLog:

	PR target/97865
	* configure: Regenerate.

libbacktrace/ChangeLog:

	PR target/97865
	* configure: Regenerate.

libffi/ChangeLog:

	PR target/97865
	* configure: Regenerate.

libgfortran/ChangeLog:

	PR target/97865
	* configure: Regenerate.

libgomp/ChangeLog:

	PR target/97865
	* configure: Regenerate.

libhsail-rt/ChangeLog:

	PR target/97865
	* configure: Regenerate.

libobjc/ChangeLog:

	PR target/97865
	* configure: Regenerate.

libphobos/ChangeLog:

	PR target/97865
	* configure: Regenerate.

libquadmath/ChangeLog:

	PR target/97865
	* configure: Regenerate.

libssp/ChangeLog:

	PR target/97865
	* configure: Regenerate.

libstdc++-v3/ChangeLog:

	PR target/97865
	* configure: Regenerate.

libvtv/ChangeLog:

	PR target/97865
	* configure: Regenerate.

zlib/ChangeLog:

	PR target/97865
	* configure: Regenerate.
2020-12-05 08:43:20 +00:00
GCC Administrator
a9625c50dd Daily bump. 2020-11-30 00:16:27 +00:00
John David Anglin
4e4ba6478a Fix hppa64-hpux11 build to remove source paths from embedded path.
This change adds the +nodefaultrpath ld option to remove all library
paths that were specified with the -L option from the embedded path.

2020-11-29  John David Anglin  <danglin@gcc.gnu.org>

ChangeLog:
	* libtool.m4 (archive_cmds): Add +nodefaultrpath ld option on
	hppa64-*-hpux11*.

libatomic/ChangeLog:
	* configure: Regenerate.

libbacktrace/ChangeLog:
	* configure: Regenerate.

libcc1/ChangeLog:
	* configure: Regenerate.

libffi/ChangeLog:
	* configure: Regenerate.

libgfortran/ChangeLog:
	* configure: Regenerate.

libgomp/ChangeLog:
	* configure: Regenerate.

libhsail-rt/ChangeLog:
	* configure: Regenerate.

libitm/ChangeLog:
	* configure: Regenerate.

libobjc/ChangeLog:
	* configure: Regenerate.

liboffloadmic/ChangeLog:
	* configure: Regenerate.
	* plugin/configure: Regenerate.

libquadmath/ChangeLog:
	* configure: Regenerate.

libsanitizer/ChangeLog:
	* configure: Regenerate.

libssp/ChangeLog:
	* configure: Regenerate.

libstdc++-v3/ChangeLog:
	* configure: Regenerate.

libvtv/ChangeLog:
	* configure: Regenerate.

lto-plugin/ChangeLog:
	* configure: Regenerate.

zlib/ChangeLog:
	* configure: Regenerate.
2020-11-29 20:11:38 +00:00
GCC Administrator
0f5f9ed5e5 Daily bump. 2020-11-12 00:16:39 +00:00
Patrick Palka
61827d5d9a c++: Correct the handling of alignof(expr) [PR88115]
We're currently neglecting to set the ALIGNOF_EXPR_STD_P flag on an
ALIGNOF_EXPR when its operand is an expression.  This leads to us
handling alignof(expr) as if it were written __alignof__(expr), and
returning the preferred alignment instead of the ABI alignment.  In the
testcase below, this causes the first and third static_assert to fail on
x86.

gcc/cp/ChangeLog:

	PR c++/88115
	* cp-tree.h (cxx_sizeof_or_alignof_expr): Add bool parameter.
	* decl.c (fold_sizeof_expr): Pass false to
	cxx_sizeof_or_alignof_expr.
	* parser.c (cp_parser_unary_expression): Pass std_alignof to
	cxx_sizeof_or_alignof_expr.
	* pt.c (tsubst_copy): Pass false to cxx_sizeof_or_alignof_expr.
	(tsubst_copy_and_build): Pass std_alignof to
	cxx_sizeof_or_alignof_expr.
	* typeck.c (cxx_alignof_expr): Add std_alignof bool parameter
	and pass it to cxx_sizeof_or_alignof_type.  Set ALIGNOF_EXPR_STD_P
	appropriately.
	(cxx_sizeof_or_alignof_expr): Add std_alignof bool parameter
	and pass it to cxx_alignof_expr.  Assert op is either
	SIZEOF_EXPR or ALIGNOF_EXPR.

libcc1/ChangeLog:

	PR c++/88115
	* libcp1plugin.cc (plugin_build_unary_expr): Pass true to
	cxx_sizeof_or_alignof_expr.

gcc/testsuite/ChangeLog:

	PR c++/88115
	* g++.dg/cpp0x/alignof6.C: New test.
2020-11-11 14:43:38 -05:00
GCC Administrator
bb6226419f Daily bump. 2020-11-11 00:16:36 +00:00
Marek Polacek
8c0c83feb0 c++: Improve static_assert diagnostic [PR97518]
Currently, when a static_assert fails, we only say "static assertion failed".
It would be more useful if we could also print the expression that
evaluated to false; this is especially useful when the condition uses
template parameters.  Consider the motivating example, in which we have
this line:

  static_assert(is_same<X, Y>::value);

if this fails, the user has to play dirty games to get the compiler to
print the template arguments.  With this patch, we say:

  error: static assertion failed
  note: 'is_same<int*, int>::value' evaluates to false

which I think is much better.  However, always printing the condition that
evaluated to 'false' wouldn't be very useful: e.g. noexcept(fn) is
always parsed to true/false, so we would say "'false' evaluates to false"
which doesn't help.  So I wound up only printing the condition when it was
instantiation-dependent, that is, we called finish_static_assert from
tsubst_expr.

Moreover, this patch also improves the diagnostic when the condition
consists of a logical AND.  Say you have something like this:

  static_assert(fn1() && fn2() && fn3() && fn4() && fn5());

where fn4() evaluates to false and the other ones to true.  Highlighting
the whole thing is not that helpful because it won't say which clause
evaluated to false.  With the find_failing_clause tweak in this patch
we emit:

  error: static assertion failed
    6 | static_assert(fn1() && fn2() && fn3() && fn4() && fn5());
      |                                          ~~~^~

so you know right away what's going on.  Unfortunately, when you combine
both things, that is, have an instantiation-dependent expr and && in
a static_assert, we can't yet quite point to the clause that failed.  It
is because when we tsubstitute something like is_same<X, Y>::value, we
generate a VAR_DECL that doesn't have any location.  It would be awesome
if we could wrap it with a location wrapper, but I didn't see anything
obvious.

In passing, I've cleaned up some things:
* use iloc_sentinel when appropriate,
* it's nicer to call contextual_conv_bool instead of the rather verbose
  perform_implicit_conversion_flags,
* no need to check for INTEGER_CST before calling integer_zerop.

gcc/cp/ChangeLog:

	PR c++/97518
	* cp-tree.h (finish_static_assert): Adjust declaration.
	* parser.c (cp_parser_static_assert): Pass false to
	finish_static_assert.
	* pt.c (tsubst_expr): Pass true to finish_static_assert.
	* semantics.c (find_failing_clause_r): New function.
	(find_failing_clause): New function.
	(finish_static_assert): Add a bool parameter.  Use
	iloc_sentinel.  Call contextual_conv_bool instead of
	perform_implicit_conversion_flags.  Don't check for INTEGER_CST before
	calling integer_zerop.  Call find_failing_clause and maybe use its
	location.  Print the original condition or the failing clause if
	SHOW_EXPR_P.

gcc/testsuite/ChangeLog:

	PR c++/97518
	* g++.dg/diagnostic/pr87386.C: Adjust expected output.
	* g++.dg/diagnostic/static_assert1.C: New test.
	* g++.dg/diagnostic/static_assert2.C: New test.

libcc1/ChangeLog:

	PR c++/97518
	* libcp1plugin.cc (plugin_add_static_assert): Pass false to
	finish_static_assert.
2020-11-10 15:08:06 -05:00
GCC Administrator
44cab2d8fd Daily bump. 2020-11-07 00:16:39 +00:00
Nathan Sidwell
ba6498124c core: Rename DECL_IS_BUILTIN -> DECL_IS_UNDECLARED_BUILTIN
In cleaning up C++'s handling of hidden decls, I renamed its
DECL_BUILTIN_P, which checks for loc == BUILTINS_LOCATION to
DECL_UNDECLARED_BUILTIN_P, because the location gets updated, if user
source declares the builtin, and the predicate no longer holds.  The
original name was confusing me.  (The builtin may still retain builtin
properties in the redeclaration, and other predicates can still detect
that.)

I discovered that tree.h had its own variant 'DECL_IS_BUILTIN', which
behaves in (almost) the same manner.  And therefore has the same
mutating behaviour.

This patch deletes the C++ one, and renames tree.h's to
DECL_IS_UNDECLARED_BUILTIN, to emphasize its non-constantness.  I
guess _IS_ wins over _P

	gcc/
	* tree.h (DECL_IS_BUILTIN): Rename to ...
	(DECL_IS_UNDECLARED_BUILTIN): ... here.  No need to use SOURCE_LOCUS.
	* calls.c (maybe_warn_alloc_args_overflow): Adjust for rename.
	* cfgexpand.c (pass_expand::execute): Likewise.
	* dwarf2out.c (base_type_die, is_naming_typedef_decl): Likewise.
	* godump.c (go_decl, go_type_decl): Likewise.
	* print-tree.c (print_decl_identifier): Likewise.
	* tree-pretty-print.c (dump_generic_node): Likewise.
	* tree-ssa-ccp.c (pass_post_ipa_warn::execute): Likewise.
	* xcoffout.c (xcoff_assign_fundamental_type_number): Likewise.
	gcc/c-family/
	* c-ada-spec.c (collect_ada_nodes): Rename
	DECL_IS_BUILTIN->DECL_IS_UNDECLARED_BUILTIN.
	(collect_ada_node): Likewise.
	(dump_forward_type): Likewise.
	* c-common.c (set_underlying_type): Rename
	DECL_IS_BUILTIN->DECL_IS_UNDECLARED_BUILTIN.
	(user_facing_original_type, c_common_finalize_early_debug): Likewise.
	gcc/c/
	* c-decl.c (diagnose_mismatched_decls): Rename
	DECL_IS_BUILTIN->DECL_IS_UNDECLARED_BUILTIN.
	(warn_if_shadowing, implicitly_declare, names_builtin_p)
	(collect_source_refs): Likewise.
	* c-typeck.c (inform_declaration, inform_for_arg)
	(convert_for_assignment): Likewise.
	gcc/cp/
	* cp-tree.h (DECL_UNDECLARED_BUILTIN_P): Delete.
	* cp-objcp-common.c (names_bultin_p): Rename
	DECL_IS_BUILTIN->DECL_IS_UNDECLARED_BUILTIN.
	* decl.c (decls_match): Likewise.  Replace
	DECL_UNDECLARED_BUILTIN_P with DECL_IS_UNDECLARED_BUILTIN.
	(duplicate_decls): Likewise.
	* decl2.c (collect_source_refs): Likewise.
	* name-lookup.c (anticipated_builtin_p, print_binding_level)
	(do_nonmember_using_decl): Likewise.
	* pt.c (builtin_pack_fn_p): Likewise.
	* typeck.c (error_args_num): Likewise.
	gcc/lto/
	* lto-symtab.c (lto_symtab_merge_decls_1): Rename
	DECL_IS_BUILTIN->DECL_IS_UNDECLARED_BUILTIN.
	gcc/go/
	* go-gcc.cc (Gcc_backend::call_expression): Rename
	DECL_IS_BUILTIN->DECL_IS_UNDECLARED_BUILTIN.
	libcc1/
	* libcc1plugin.cc (address_rewriter): Rename
	DECL_IS_BUILTIN->DECL_IS_UNDECLARED_BUILTIN.
	* libcp1plugin.cc (supplement_binding): Likewise.
2020-11-06 10:50:51 -08:00
GCC Administrator
b2698c21f2 Daily bump. 2020-10-15 00:16:34 +00:00
Nathan Sidwell
068644a149 c++: DECL_FRIEND_P cleanup
DECL_FRIEND_P's meaning has changed over time.  It now (almost) means
the the friend function decl has not been met via an explicit decl.
This completes that transition, renaming it to DECL_UNIQUE_FRIEND_P,
so one doesn't think it is the sole indicator of friendliness (plenty
of friends do not have the flag set).  This allows reduction in the
complexity of managing the field -- all in duplicate_decls now.

	gcc/cp/
	* cp-tree.h (struct lang_decl_fn): Adjust context comment.
	(DECL_FRIEND_P): Replace with ...
	(DECL_UNIQUE_FRIEND_P): ... this.  Only for FUNCTION_DECLs.
	(DECL_FRIEND_CONTEXT): Adjust.
	* class.c (add_implicitly_declared_members): Detect friendly
	spaceship from context.
	* constraint.cc (remove_constraints): Use a checking assert.
	(maybe_substitute_reqs_for): Use DECL_UNIQUE_FRIEND_P.
	* decl.c (check_no_redeclaration_friend_default_args):
	DECL_UNIQUE_FRIEND_P is signficant, not hiddenness.
	(duplicate_decls): Adjust DECL_UNIQUE_FRIEND_P clearing.
	(redeclaration_error_message): Use DECL_UNIQUE_FRIEND_P.
	(start_preparsed_function): Correct in-class friend processing.
	Refactor some initializers.
	(grokmethod): Directly check friend decl-spec.
	* decl2.c (grokfield): Check DECL_UNIQUE_FRIEND_P.
	* friend.c (do_friend): Set DECL_UNIQUE_FRIEND_P first, remove
	extraneous conditions.  Don't re set it afterwards.
	* name-lookup.c (lookup_elaborated_type_1): Simplify revealing
	code.
	(do_pushtag): Likewise.
	* pt.c (optimize_specialization_lookup_p): Check
	DECL_UNIQUE_FRIEND_P.
	(push_template_decl): Likewise.  Drop unneeded friend setting.
	(type_dependent_expression_p): Check DECL_UNIQUE_FRIEND_P.
	libcc1/
	* libcp1plugin.cc (plugin_add_friend): Set DECL_UNIQUE_FRIEND_P.
2020-10-14 10:04:18 -07:00
GCC Administrator
6caec77e3b Daily bump. 2020-10-08 00:16:30 +00:00
Nathan Sidwell
99e9b54313 c++: Rename DECL_BUILTIN_P to DECL_UNDECLARED_BUILTIN_P
I realized I'd misnamed DECL_BUILTIN_P, it's only true of compiler
builtins unless and until the user declares them -- at that point
they're real decls, and will have a location in the user's source.
(BUILT_IN_FN and friends still work though).  This renames them so
future-me is not confused as to why the predicate becomes false.

	gcc/cp/
	* cp-tree.h (DECL_BUILTIN_P): Rename to ...
	(DECL_UNDECLARED_BUILTIN_P): ... here.
	* decl.c (duplicate_decls): Adjust.
	* name-lookup.c (anticipated_builtin_p): Adjust.
	(do_nonmember_using_decl): Likewise.
	libcc1/
	* libcp1plugin.cc (supplement_binding): Rename
	DECL_BUILTIN_P.
2020-10-07 05:06:52 -07:00
GCC Administrator
b0b9b8f02a Daily bump. 2020-10-03 00:16:25 +00:00
Nathan Sidwell
679dbc9dce c++: Kill DECL_ANTICIPATED
Here's the patch to remove DECL_ANTICIPATED, and with it hiddenness is
managed entirely in the symbol table.  Sadly I couldn't get rid of the
actual field without more investigation -- it's repurposed for
OMP_PRIVATIZED_MEMBER.  It looks like a the VAR-related flags in
lang_decl_base are not completely orthogonal, so perhaps some can be
turned into an enumeration or something.  But that's more than I want
to do right now.

DECL_FRIEND_P Is still slightly suspect as it appears to mean more
than just in-class definition.  However, I'm leaving that for now.

	gcc/cp/
	* cp-tree.h (lang_decl_base): anticipated_p is not used for
	anticipatedness.
	(DECL_ANTICIPATED): Delete.
	* decl.c (duplicate_decls): Delete DECL_ANTICIPATED_management,
	use was_hidden.
	(cxx_builtin_function): Drop DECL_ANTICIPATED setting.
	(xref_tag_1): Drop DECL_ANTICIPATED assert.
	* name-lookup.c (name_lookup::adl_class_only): Drop
	DECL_ANTICIPATED check.
	(name_lookup::search_adl): Always dedup.
	(anticipated_builtin_p): Reimplement.
	(do_pushdecl): Drop DECL_ANTICIPATED asserts & update.
	(lookup_elaborated_type_1): Drop DECL_ANTICIPATED update.
	(do_pushtag): Drop DECL_ANTICIPATED setting.
	* pt.c (push_template_decl): Likewise.
	(tsubst_friend_class): Likewise.
	libcc1/
	* libcp1plugin.cc (libcp1plugin.cc): Drop DECL_ANTICIPATED test.
2020-10-02 12:21:08 -07:00
GCC Administrator
cdd8f031c7 Daily bump. 2020-09-26 00:16:25 +00:00
Nathan Sidwell
a28542df4d c++: DECL_BUILTIN_P for builtins
We currently detect builtin decls via DECL_ARTIFICIAL &&
!DECL_HIDDEN_FUNCTION_P, which, besides being clunky, is a problem as
hiddenness is a property of the symbol table -- not the decl being
hidden.  This adds DECL_BUILTIN_P, which just looks at the
SOURCE_LOCATION -- we have a magic one for builtins.

One of the consequential changes is to make function-scope omp udrs
have function context (needed because otherwise duplicate-decls thinks
the types don't match at the point we check).  This is also morally
better, because that's what they are -- nested functions, stop lying.

(That's actually my plan for all DECL_LOCAL_DECL_P decls, as they are
distinct decls to the namespace-scope decl they alias.)

	gcc/cp/
	* cp-tree.h (DECL_BUILTIN_P): New.
	* decl.c (duplicate_decls): Use it.  Do not treat omp-udr as a
	builtin.
	* name-lookup.c (anticipated_builtin): Use it.
	(set_decl_context_in_fn): Function-scope OMP UDRs have function context.
	(do_nonmember_using_decl): Use DECL_BUILTIN_P.
	* parser.c (cp_parser_omp_declare_reduction): Function-scope OMP
	UDRs have function context.  Assert we never find a valid duplicate.
	* pt.c (tsubst_expr): Function-scope OMP UDRs have function context.
	libcc1/
	* libcp1plugin.cc (supplement_binding): Use DECL_BULTIN_P.
2020-09-25 06:58:07 -07:00
GCC Administrator
a2b7397b50 Daily bump. 2020-09-25 00:16:27 +00:00
Nathan Sidwell
d13c0ae859 c++: Cleanup some decl pushing apis
In cleaning up local decl handling, here's an initial patch that takes
advantage of C++'s default args for the is_friend parm of pushdecl,
duplicate_decls and push_template_decl_real and the scope & tpl_header
parms of xref_tag.  Then many of the calls simply not mention these.
I also rename push_template_decl_real to push_template_decl, deleting
the original forwarding function.  This'll make my later patches
changing their types less intrusive.  There are 2 functional changes:

1) push_template_decl requires is_friend to be correct, it doesn't go
checking for a friend function (an assert is added).

2) debug_overload prints out Hidden and Using markers for the overload set.

	gcc/cp/
	* cp-tree.h (duplicate_decls): Default is_friend to false.
	(xref_tag): Default tag_scope & tpl_header_p to ts_current & false.
	(push_template_decl_real): Default is_friend to false.  Rename to
	...
	(push_template_decl): ... here.  Delete original decl.
	* name-lookup.h (pushdecl_namespace_level): Default is_friend to
	false.
	(pushtag): Default tag_scope to ts_current.
	* coroutines.cc (morph_fn_to_coro): Drop default args to xref_tag.
	* decl.c (start_decl): Drop default args to duplicate_decls.
	(start_enum): Drop default arg to pushtag & xref_tag.
	(start_preparsed_function): Pass DECL_FRIEND_P to
	push_template_decl.
	(grokmethod): Likewise.
	* friend.c (do_friend): Rename push_template_decl_real calls.
	* lambda.c (begin_lamnbda_type): Drop default args to xref_tag.
	(vla_capture_type): Likewise.
	* name-lookup.c (maybe_process_template_type_declaration): Rename
	push_template_decl_real call.
	(pushdecl_top_level_and_finish): Drop default arg to
	pushdecl_namespace_level.
	* pt.c (push_template_decl_real): Assert no surprising friend
	functions.  Rename to ...
	(push_template_decl): ... here.  Delete original function.
	(lookup_template_class_1): Drop default args from pushtag.
	(instantiate_class_template_1): Likewise.
	* ptree.c (debug_overload): Print hidden and using markers.
	* rtti.c (init_rtti_processing): Drop refault args from xref_tag.
	(build_dynamic_cast_1, tinfo_base_init): Likewise.
	* semantics.c (begin_class_definition): Drop default args to
	pushtag.
	gcc/objcp/
	* objcp-decl.c (objcp_start_struct): Drop default args to
	xref_tag.
	(objcp_xref_tag): Likewise.
	libcc1/
	* libcp1plugin.cc (supplement_binding): Drop default args to
	duplicate_decls.
	(safe_pushtag): Drop scope parm.  Drop default args to pushtag.
	(safe_pushdecl_maybe_friend): Rename to ...
	(safe_pushdecl): ... here. Drop is_friend parm.  Drop default args
	to pushdecl.
	(plugin_build_decl): Adjust safe_pushdecl & safe_pushtag calls.
	(plugin_build_constant): Adjust safe_pushdecl call.
2020-09-24 12:56:59 -07:00
GCC Administrator
fdcc0283c6 Daily bump. 2020-09-11 00:16:28 +00:00
Nathan Sidwell
f40866967d c++: DECL_LOCAL_FUNCTION_P -> DECL_LOCAL_DECL_P
Our handling of block-scope extern decls is insufficient for modern
C++, in particular modules, (but also constexprs).  We mark such local
function decls, and this patch extends that to marking local var decls
too, so mainly a macro rename.  Also, we set this flag earlier, rather
than learning about it when pushing the decl.  This is a step towards
handling these properly.

	gcc/cp/
	* cp-tree.h (DECL_LOCAL_FUNCTION_P): Rename to ...
	(DECL_LOCAL_DECL_P): ... here.  Accept both fns and vars.
	* decl.c (start_decl): Set DECL_LOCAL_DECL_P for local externs.
	(omp_declare_variant_finalize_one): Use DECL_LOCAL_DECL_P.
	(local_variable_p): Simplify.
	* name-lookup.c (set_decl_context_in_fn): Assert DECL_LOCAL_DECL_P
	is as expected.  Simplify.
	(do_pushdecl): Don't set decl_context_in_fn for friends.
	(is_local_extern): Simplify.
	* call.c (equal_functions): Use DECL_LOCAL_DECL_P.
	* parser.c (cp_parser_postfix_expression): Likewise.
	(cp_parser_omp_declare_reduction): Likewise.
	* pt.c (check_default_tmpl_args): Likewise.
	(tsubst_expr): Assert nested reduction function is local.
	(type_dependent_expression_p): Use DECL_LOCAL_DECL_P.
	* semantics.c (finish_call_expr): Likewise.
	libcc1/
	* libcp1plugin.cc (plugin_build_call_expr): Use DECL_LOCAL_DECL_P.
2020-09-10 05:45:46 -07:00
GCC Administrator
661ee09b8b Daily bump. 2020-08-15 00:16:22 +00:00
Nathan Sidwell
f00008b45a c++: Final bit of name-lookup api simplification
We no longer need to give name_lookup_real not name_lookup_nonclass
different names to the name_lookup functions.  This renames the lookup
functions thusly.

	gcc/cp/
	* name-lookup.h (lookup_name_real, lookup_name_nonclass): Rename
	to ...
	(lookup_name): ... these new overloads.
	* name-lookup.c (identifier_type_value_1): Rename lookup_name_real
	call.
	(lookup_name_real_1): Rename to ...
	(lookup_name_1): ... here.
	(lookup_name_real): Rename to ...
	(lookup_name): ... here.  Rename lookup_name_real_1 call.
	(lookup_name_nonclass): Delete.
	* call.c (build_operator_new_call): Rename lookup_name_real call.
	(add_operator_candidates): Likewise.
	(build_op_delete_call): Rename lookup_name_nonclass call.
	* parser.c (cp_parser_lookup_name): Likewise.
	* pt.c (tsubst_friend_class, lookup_init_capture_pack): Likewise.
	(tsubst_expr): Likewise.
	* semantics.c (capture_decltype): Likewise.
	libcc1/
	* libcp1plugin.cc (plugin_build_dependent_expr): Rename
	lookup_name_real call.
2020-08-14 16:55:35 -07:00
Nathan Sidwell
db1c2a89db c++: Yet more name-lookup api simplification
This patch deals with LOOKUP_HIDDEN, which originally meant 'find
hidden friends', but it's being pressed into service for not ignoring
lambda-relevant internals.  However these two functions are different.
(a) hidden friends can occur in block scope (very uncommon) and (b) it
had the semantics of stopping after the innermost enclosing
namepspace.  That's really suspect for the lambda case, but not
relevant there because we never get to namespace scope (I think).
Anyway, I've split the flag into two and adjusted the lambda callers
to just search block scope.  These two flags are added to the
LOOK_want enum class, which allows dropping another parameter from the
name lookup routines.

The remaining LOOKUP_$FOO flags in cp-tree.h are, I think, now all
related to features of overload resolution, conversion operators and
reference binding.  Nothing to do with /name/ lookup.

	gcc/cp/
	* cp-tree.h (LOOKUP_HIDDEN): Delete.
	(LOOKUP_PREFER_RVALUE): Adjust initializer.
	* name-lookup.h (enum class LOOK_want): Add HIDDEN_FRIEND and
	HIDDEN_LAMBDA flags.
	(lookup_name_real): Drop flags parm.
	(lookup_qualified_name): Drop find_hidden parm.
	* name-lookup.c (class name_lookup): Drop hidden field, adjust
	ctors.
	(name_lookup::add_overload): Check want for hiddenness.
	(name_lookup::process_binding): Likewise.
	(name_lookup::search_unqualified): Likewise.
	(identifier_type_value_1): Adjust lookup_name_real call.
	(set_decl_namespace): Adjust name_lookup ctor.
	(qualify_lookup): Drop flags parm, use want for hiddenness.
	(lookup_qualified_name): Drop find_hidden parm.
	(lookup_name_real_1): Drop flags parm, adjust qualify_lookup
	calls.
	(lookup_name_real): Drop flags parm.
	(lookup_name_nonclass, lookup_name): Adjust lookup_name_real
	calls.
	(lookup_type_scope_1): Adjust qualify_lookup calls.
	* call.c (build_operator_new_call): Adjust lookup_name_real call.
	(add_operator_candidates): Likewise.
	* coroutines.cc (morph_fn_to_coro): Adjust lookup_qualified_name
	call.
	* parser.c (cp_parser_lookup_name): Adjust lookup_name_real calls.
	* pt.c (check_explicit_specialization): Adjust
	lookup_qualified_name call.
	(deduction_guides_for): Likewise.
	(tsubst_friend_class): Adjust lookup_name_real call.
	(lookup_init_capture_pack): Likewise.
	(tsubst_expr): Likewise, don't look in namespaces.
	* semantics.c (capture_decltype): Adjust lookup_name_real.  Don't
	look in namespaces.
	libcc1/
	* libcp1plugin.cc (plugin_build_dependent_exp): Adjust
	lookup_name_real call.
2020-08-14 10:54:53 -07:00
Nathan Sidwell
4c58a32f47 c++: More simplification of name_lookup api
Continuing fixing name lookup's API we have two parameters saying what
we'd like to find 'prefer_type', which is a tri-valued boolan with
meaning 'don't care', 'type or namespace', 'type or death'.  And we
have a second parameter 'namespaces_only', which means 'namespace or
death'.  There are only 4 states, because the latter one has priority.
Firstly 'prefer_type' isn't really the right name -- it's not a preference,
it's a requirement.  Name lookup maps those two parameters into 2 LOOKUP_
bits.  We can simply have callers express that desire directly.

So this adds another enum class, LOOK_want, which expresses all
those options in 2 bits.  Most of this patch is then the expected fallout
from such a change.  The parser was mapping its internal state into
a prefer_type value, which was then mapped into the LOOKUP_ bits. So this
saves a conversion there.  Also the parser's conversion routine had an
'is_template' flag, which was only ever true in one place, where the parser
also had to deal with other nuances of the flags to pass.  So just drop
that parm and deal with it at the call site too.

I've left LOOKUP_HIDDEN alone for the moment.  That'll be next.

	gcc/cp/
	* cp-tree.h (LOOKUP_PREFER_TYPES, LOOKUP_PREFER_NAMESPACES)
	(LOOKUP_NAMESPACES_ONLY, LOOKUP_TYPES_ONLY)
	(LOOKUP_QUALIFIERS_ONL): Delete.
	(LOOKUP_HIDDEN): Adjust.
	* name-lookup.h (enum class LOOK_want): New.
	(operator|, operator&): Overloads for it.
	(lookup_name_real): Replace prefer_type & namespaces_only with
	LOOK_want parm.
	(lookup_qualified_name): Replace prefer_type with LOOK_want.
	(lookup_name_prefer_type): Replace with ...
	(lookup_name): ... this.  New overload with LOOK_want parm.
	* name-lookup.c (struct name_lookup): Replace flags with want and
	hidden fields.  Adjust constructors.
	(name_lookyp::add_overload): Correct hidden stripping test.  Update
	for new LOOK_want type.
	(name_lookup::process_binding): Likewise.
	(name_lookup::search_unqualified): Use hidden flag.
	(identifier_type_value_1): Adjust lookup_name_real call.
	(set_decl_namespace): Adjust name_lookup ctor.
	(lookup_flags): Delete.
	(qualify_lookup): Add LOOK_want parm, adjust.
	(lookup_qualified_name): Replace prefer_type parm with LOOK_want.
	(lookup_name_real_1): Replace prefer_type and namespaces_only with
	LOOK_want parm.
	(lookup_name_real): Likewise.
	(lookup_name_nonclass, lookup_name): Adjust lookup_name_real call.
	(lookup_name_prefer_type): Rename to ...
	(lookup_name): ... here.  New overload with LOOK_want parm.
	(lookup_type_scope_1): Adjust qualify_lookup calls.
	* call.c (build_operator_new_call)
	(add_operator_candidates): Adjust lookup_name_real calls.
	* coroutines.cc (find_coro_traits_template_decl)
	(find_coro_handle_template_decl, morph_fn_to_coro): Adjust
	lookup_qualified_name calls.
	* cp-objcp-common.c (identifier_global_tag): Likewise.
	* decl.c (get_tuple_size, get_tuple_decomp_init): Likewise.
	(lookup_and_check_tag): Use lookup_name overload.
	* parser.c (cp_parser_userdef_numeric_literal): Adjust
	lookup_qualified_name call.
	(prefer_arg_type): Drop template_mem_access parm, return LOOK_want
	value.
	(cp_parser_lookup_name): Adjust lookup_member, lookup_name_real
	calls.
	* pt.c (check_explicit_specialization): Adjust lookup_qualified_name
	call.
	(tsubst_copy_and_build, tsubst_qualified_name): Likewise
	(deduction_guides_for): Likewise.
	(tsubst_friend_class): Adjust lookup_name_real call.
	(lookup_init_capture, tsubst_expr): Likewise.
	* rtti.c (emit_support_tinfos): Adjust lookup_qualified_name call.
	* semantics.c (omp_reduction_lookup): Likewise.
	(capture_decltype): Adjust lookup_name_real call.
	libcc1/
	* libcp1plugin.cc (plugin_build_dependent_expr): Adjust
	lookup_name_real & lookup_qualified_name calls.
2020-08-14 07:44:46 -07:00
GCC Administrator
b3cb56060b Daily bump. 2020-08-14 00:16:24 +00:00
Nathan Sidwell
0c5f6bbfe2 [c++]: Unconfuse lookup_name_real API a bit
The API for lookup_name_real is really confusing.  This addresses the part
where we have NONCLASS to say DON'T search class scopes, and BLOCK_P to say
DO search block scopes.  I've added a single bitmask to explicitly say which
scopes to search.  I used an enum class so one can't accidentally misorder
it.  It's also reordered so we don't mix it up with the parameters that say
what kind of thing we're looking for.

	gcc/cp/
	* name-lookup.h (enum class LOOK_where): New.
	(operator|, operator&): Overloads for it.
	(lookup_name_real): Replace NONCLASS & BLOCK_P parms with WHERE.
	* name-lookup.c (identifier_type_value_w): Adjust
	lookup_name_real call.
	(lookup_name_real_1): Replace NONCLASS and BLOCK_P parameters
	with WHERE bitmask. Don't search namespaces if not asked to.
	(lookup_name_real): Adjust lookup_name_real_1 call.
	(lookup_name_nonclass, lookup_name)
	(lookup_name_prefer_type): Likewise.
	* call.c (build_operator_new_call)
	(add_operator_candidates): Adjust lookup_name_real calls.
	* parser.c (cp_parser_lookup_name): Likewise.
	* pt.c (tsubst_friend_class, lookup_init_capture_pack)
	(tsubst_expr): Likewise.
	* semantics.c (capture_decltype): Likewise.
	libcc1/
	* libcp1plugin.cc (plugin_build_dependent_expr): Likewise.
2020-08-13 11:16:42 -07:00
GCC Administrator
d48cca8f21 Daily bump. 2020-07-31 00:16:26 +00:00
H.J. Lu
4712bde3ca Require CET support only for the final GCC build
With --enable-cet, require CET support only for the final GCC build.
Don't enable CET without CET support for non-bootstrap build, in stage1
nor for build support.

config/

	PR bootstrap/96202
	* cet.m4 (GCC_CET_HOST_FLAGS): Don't enable CET without CET
	support in stage1 nor for build support.

gcc/

	PR bootstrap/96202
	* configure: Regenerated.

libbacktrace/

	PR bootstrap/96202
	* configure: Regenerated.

libcc1/

	PR bootstrap/96202
	* configure: Regenerated.

libcpp/

	PR bootstrap/96202
	* configure: Regenerated.

libdecnumber/

	PR bootstrap/96202
	* configure: Regenerated.

libiberty/

	PR bootstrap/96202
	* configure: Regenerated.

lto-plugin/

	PR bootstrap/96202
	* configure: Regenerated.
2020-07-30 05:36:24 -07:00
GCC Administrator
46fbb6c682 Daily bump. 2020-07-01 00:16:26 +00:00
Nathan Sidwell
cc3ae9f5c4 c++: Tweak function cloning names
On the modules branch I need to expose an intermediate step of the
function cloning, but before that it'd be nice to rationalize the
names somewhat, now that we also use that API for copying the equality
operator.  Jason's recent patch caused me some pain by altering the
same code.  I can only blame myself for not pushing some bits sooner.
Anyway, this patch makes the newly renamed copy_fndecl_with_name
static, and adds a wrapper copy_operator_fn, that takes an operator
code.  The cdtor cloning functions are renamed to explicitly note they
expect cdtors.  A followup patch will move some of the logic from
copy_fndecl_with_name to build_cdtor_clones.

gcc/cp/
	* cp-tree.h (copy_fndecl_with_name): Rename to ...
	(copy_operatorn_fn): ... this.  Change arg type.
	(clone_function_decl): Rename to ...
	(clone_cdtor): ... this.
	* class.c (copy_fndecl_with_name): Make static.
	(copy_operator_fn): New wrapper.
	(build_clones): Rename to ...
	(build_cdtor_clones): ... this.
	(clone_function_decl): Rename to ...
	(clone_cdtor): ... this.  Adjust build_clones calls.
	(clone_constructors_and_destructors): Adjust clone_function_decl
	calls.
	* method.c (implicitly_declare_fn): Adjust copy_fndecl_with_name
	call.
	(lazily_declare_fn): Adjust clone_function_decl call.
	* pt.c (tsubst_function_decl): Likewise.
	(instantiate_template_1): Likewise.

libcc1/
	* libcp1plugin.cc (plugin_build_decl): Adjust clone_function_decl
	call.
2020-06-30 10:50:05 -07:00
GCC Administrator
885ef72f27 Daily bump. 2020-05-30 00:16:27 +00:00
H.J. Lu
9051b54827 Avoid nested save_CFLAGS and save_LDFLAGS
Avoid nested save_CFLAGS and save_LDFLAGS by replacing save_CFLAGS and
save_LDFLAGS with cet_save_CFLAGS and cet_save_LDFLAGS in cet.m4.

config/

	PR bootstrap/95413
	* cet.m4: Replace save_CFLAGS and save_LDFLAGS with
	cet_save_CFLAGS and cet_save_LDFLAGS.

gcc/

	PR bootstrap/95413
	* configure: Regenerated.

libatomic/

	PR bootstrap/95413
	* configure: Regenerated.

libbacktrace/

	PR bootstrap/95413
	* configure: Regenerated.

libcc1/

	PR bootstrap/95413
	* configure: Regenerated.

libcpp/

	PR bootstrap/95413
	* configure: Regenerated.

libdecnumber/

	PR bootstrap/95413
	* configure: Regenerated.

libgcc/

	PR bootstrap/95413
	* configure: Regenerated.

libgfortran/

	PR bootstrap/95413
	* configure: Regenerated.

libgomp/

	PR bootstrap/95413
	* configure: Regenerated.

libiberty/

	PR bootstrap/95413
	* configure: Regenerated.

libitm/

	PR bootstrap/95413
	* configure: Regenerated.

libobjc/

	PR bootstrap/95413
	* configure: Regenerated.

libphobos/

	PR bootstrap/95413
	* configure: Regenerated.

libquadmath/

	PR bootstrap/95413
	* configure: Regenerated.

libsanitizer/

	PR bootstrap/95413
	* configure: Regenerated.

libssp/

	PR bootstrap/95413
	* configure: Regenerated.

libstdc++-v3/

	PR bootstrap/95413
	* configure: Regenerated.

libvtv/

	PR bootstrap/95413
	* configure: Regenerated.

lto-plugin/

	PR bootstrap/95413
	* configure: Regenerated.

zlib/

	PR bootstrap/95413
	* configure: Regenerated.
2020-05-29 12:56:40 -07:00
H.J. Lu
8d286dd118 x86: Default CET run-time support to auto
CET has been added since GCC 8.  This patch defaults CET run-time support
to auto.  It enables CET run-time support if asssembler supports CET
instructions and multi-byte NOPs are enabled via SSE2.

config/

	* cet.m4 (GCC_CET_FLAGS): Change default to auto.

gcc/

	* configure: Regenerated.

libatomic/

	* configure: Regenerated.

libbacktrace/

	* configure: Regenerated.

libcc1/

	* configure: Regenerated.

libcpp/

	* configure: Regenerated.

libdecnumber/

	* configure: Regenerated.

libgcc/

	* configure: Regenerated.

libgfortran/

	* configure: Regenerated.

libgomp/

	* configure: Regenerated.

libitm/

	* configure: Regenerated.

libobjc/

	* configure: Regenerated.

libquadmath/

	* configure: Regenerated.

libsanitizer/

	* configure: Regenerated.

libssp/

	* configure: Regenerated.

libstdc++-v3/

	* configure: Regenerated.

libvtv/

	* configure: Regenerated.

zlib/

	* configure: Regenerated.
2020-05-14 09:05:02 -07:00
H.J. Lu
af3bef0ea2 libcc1: Enable Intel CET on Intel CET enabled host
Since on Intel CET enabled host, dlopen in Intel CET enabled applications
fails on shared libraries which aren't Intel CET enabled, enable Intel
CET in libcc1 on Intel CET enabled host.

	* Makefile.am (AM_CXXFLAGS): Add $(CET_HOST_FLAGS).
	* configure.ac: Add GCC_CET_HOST_FLAGS(CET_HOST_FLAGS) and
	AC_SUBST(CET_HOST_FLAGS).
	* Makefile.in: Regenerated.
	* aclocal.m4: Likewise.
	* configure: Likewise.
2020-05-12 09:12:37 -07:00
Patrick Palka
a6ee556c76 c++: Fix return type deduction with an abbreviated function template
This patch fixes two issues with return type deduction in the presence of an
abbreviated function template.

The first issue (PR 69448) is that if a placeholder auto return type contains
any modifiers such as & or *, then the abbreviated function template
compensation in splice_late_return_type does not get performed for the
underlying auto node, leading to incorrect return type deduction.  This happens
because splice_late_return_type does not consider that a placeholder auto return
type might have modifiers.  To fix this it seems we need to look through
modifiers in the return type to obtain the location of the underlying auto node
in order to replace it with the adjusted auto node.  To that end this patch
refactors the utility function find_type_usage to return a pointer to the
matched tree, and uses it to find and replace the underlying auto node.

The second issue (PR 80471) is that the AUTO_IS_DECLTYPE flag is not being
preserved in splice_late_return_type when compensating for an abbreviated
function template, leading to us treating a decltype(auto) return type as if it
was an auto return type.  Fixed by making make_auto_1 set the AUTO_IS_DECLTYPE
flag whenever we're building a decltype(auto) node and adjusting callers
appropriately.  The test for PR 80471 is adjusted to expect the correct
behavior.

gcc/cp/ChangeLog:

	PR c++/69448
	PR c++/80471
	* type-utils.h (find_type_usage): Refactor to take a tree * and to
	return a tree *, and update documentation accordingly.
	* pt.c (make_auto_1): Set AUTO_IS_DECLTYPE when building a
	decltype(auto) node.
	(make_constrained_decltype_auto): No need to explicitly set
	AUTO_IS_DECLTYPE anymore.
	(splice_late_return_type): Use find_type_usage to find and
	replace a possibly nested auto node instead of using is_auto.
	Check test for is_auto into an assert when deciding whether
	to late_return_type.
	(type_uses_auto): Adjust the call to find_type_usage.
	* parser.c (cp_parser_decltype): No need to explicitly set
	AUTO_IS_DECLTYPE anymore.

libcc1/ChangeLog:

	PR c++/69448
	PR c++/80471
	* libcp1plugin.cc (plugin_get_expr_type): No need to explicitly set
	AUTO_IS_DECLTYPE anymore.

gcc/testsuite/ChangeLog:

	PR c++/69448
	PR c++/80471
	* g++.dg/concepts/abbrev3.C: New test.
	* g++.dg/cpp2a/concepts-pr80471.C: Adjust a static_assert to expect the
	correct behavior.
	* g++.dg/cpp0x/auto9.C: Adjust a dg-error directive.
2020-02-10 20:43:53 -05:00
Paolo Carlini
87d3f828de init.c (build_new): Add location_t parameter and use it throughout.
/gcc/cp
2020-01-07  Paolo Carlini  <paolo.carlini@oracle.com>

	* init.c (build_new): Add location_t parameter and use it throughout.
	(build_raw_new_expr): Likewise.
	* parser.c (cp_parser_new_expression): Pass the combined_loc.
	* pt.c (tsubst_copy_and_build): Adjust call.
	* cp-tree.h: Update declarations.

/libcc1
2020-01-07  Paolo Carlini  <paolo.carlini@oracle.com>

	* libcp1plugin.cc (plugin_build_new_expr): Update build_new call.

/gcc/testsuite
2020-01-07  Paolo Carlini  <paolo.carlini@oracle.com>

	* g++.old-deja/g++.bugs/900208_03.C: Check locations too.
	* g++.old-deja/g++.bugs/900519_06.C: Likewise.

From-SVN: r279963
2020-01-07 17:58:18 +00:00
Jakub Jelinek
8d9254fc8a Update copyright years.
From-SVN: r279813
2020-01-01 12:51:42 +01:00
Paolo Carlini
04e4997a56 decl2.c (delete_sanity): Add location_t parameter and use it throughout.
/gcc/cp
2019-12-30  Paolo Carlini  <paolo.carlini@oracle.com>

	* decl2.c (delete_sanity): Add location_t parameter and use
	it throughout.
	* init.c (build_vec_delete_1): Likewise.
	(build_delete): Likewise.
	(build_vec_delete): Likewise.
	(perform_target_ctor): Adjust call.
	(perform_member_init): Likewise.
	(build_vec_init): Likewise.
	* decl.c (cxx_maybe_build_cleanup): Likewise.
	* pt.c (tsubst_copy_and_build): Likewise.
	* parser.c (cp_parser_delete_expression): Likewise, pass the
	combined_loc.
	* cp-tree.h: Update declarations.

/libcc1
2019-12-30  Paolo Carlini  <paolo.carlini@oracle.com>

	* libcp1plugin.cc (plugin_build_unary_expr): Update delete_sanity
	call.

/gcc/testsuite
2019-12-30  Paolo Carlini  <paolo.carlini@oracle.com>

	* g++.dg/init/delete1.C: Check locations too.
	* g++.dg/ipa/pr85607.C: Likewise.
	* g++.dg/warn/Wdelete-incomplete-1.C: Likewise.
	* g++.dg/warn/delete-non-virtual-dtor.C: Likewise.
	* g++.dg/warn/incomplete1.C: Likewise.

From-SVN: r279768
2019-12-30 13:23:40 +00:00
Paolo Carlini
d3769410c6 typeck.c (cxx_sizeof_or_alignof_type): Add location_t parameter and use it throughout.
/gcc/cp
2019-12-18  Paolo Carlini  <paolo.carlini@oracle.com>

	* typeck.c (cxx_sizeof_or_alignof_type): Add location_t parameter
	and use it throughout.
	(cxx_sizeof_expr): Likewise.
	(cxx_alignof_expr): Likewise.
	(cxx_sizeof_or_alignof_expr): Likewise.
	(cxx_alignas_expr): Update call.
	* decl.c (fold_sizeof_expr): Likewise.
	* pt.c (tsubst_copy): Likewise.
	(tsubst_copy_and_build): Likewise.
	* except.c (build_throw): Add location_t parameter and use it.
	(expand_end_catch_block): Update call.
	* parser.c (cp_parser_unary_expression): Update
	cxx_sizeof_or_alignof_type and cxx_sizeof_or_alignof_expr calls,
	pass the compound location.
	(cp_parser_throw_expression): Likewise pass the combined location
	to build_throw.
	* cp-tree.h: Update declarations.

	* semantics.c (finish_handler_parms): Use DECL_SOURCE_LOCATION.
	* decl2.c (check_classfn): Likewise.

	* except.c (is_admissible_throw_operand_or_catch_parameter):
	Exploit cp_expr_loc_or_input_loc in one place.

	* except.c (create_try_catch_expr): Remove, unused.

/libcc1
2019-12-18  Paolo Carlini  <paolo.carlini@oracle.com>

	* libcp1plugin.cc (plugin_build_unary_expr): Update build_throw
	and cxx_sizeof_or_alignof_expr calls.
	(plugin_build_unary_type_expr): Likewise for
	cxx_sizeof_or_alignof_type.

/gcc/testsuite
2019-12-18  Paolo Carlini  <paolo.carlini@oracle.com>

	* g++.dg/diagnostic/alignof2.C: New.
	* g++.dg/diagnostic/alignof3.C: Likewise.
	* g++.dg/diagnostic/incomplete-type-1.C: Likewise.
	* g++.dg/warn/Wcatch-value-3b.C: Likewise.
	* g++.dg/cpp0x/alignof3.C: Check location(s) too.
	* g++.dg/cpp1z/decomp-bitfield1.C: Likewise.
	* g++.dg/cpp1z/has-unique-obj-representations2.C: Likewise.
	* g++.dg/expr/sizeof3.C: Likewise.
	* g++.dg/ext/flexary6.C: Likewise.
	* g++.dg/ext/vla4.C: Likewise.
	* g++.dg/template/sizeof11.C: Likewise.
	* g++.dg/warn/Wcatch-value-1.C: Likewise.
	* g++.dg/warn/Wcatch-value-2.C: Likewise.
	* g++.dg/warn/Wcatch-value-3.C: Likewise.
	* g++.old-deja/g++.brendan/sizeof1.C: Likewise.
	* g++.old-deja/g++.brendan/sizeof3.C: Likewise.
	* g++.old-deja/g++.brendan/sizeof4.C: Likewise.
	* g++.old-deja/g++.eh/ctor1.C: Likewise.
	* g++.old-deja/g++.jason/ambig1.C: Likewise.
	* g++.old-deja/g++.other/sizeof4.C: Likewise.

From-SVN: r279543
2019-12-18 19:23:01 +00:00
Paolo Carlini
ca6932ad0c typeck.c (check_for_casting_away_constness): Add location_t parameter and use it.
gcc/cp
2019-12-09  Paolo Carlini  <paolo.carlini@oracle.com>

	* typeck.c (check_for_casting_away_constness): Add location_t
	parameter and use it.
	(maybe_warn_about_useless_cast): Likewise.
	(maybe_warn_about_cast_ignoring_quals): Likewise.
	(build_static_cast_1): Likewise.
	(build_static_cast): Likewise; sets the location of the returned tree.
	(build_reinterpret_cast_1): Likewise.
	(build_reinterpret_cast): Likewise; sets the location of the returned
	tree.
	(build_const_cast_1): Likewise.
	(build_const_cast): Likewise; sets the location of the returned tree.
	(cp_build_c_cast): Likewise.
	(build_c_cast): Adjust.
	(build_ptrmemfunc): Adjust calls.
	(cp_build_unary_op): Pass the location to invert_truthvalue_loc.
	* rtti.c (build_dynamic_cast_1): Add location_t parameter and
	use it.
	(build_dynamic_cast): Likewise.
	* cp-tree.h: Adjust declarations.
	* parser.c (cp_parser_postfix_expression): Pass cp_cast_loc to
	the various build_*_cast functions.
	(get_cast_suggestion): Adjust calls.
	(cp_parser_builtin_offsetof): Likewise.
	* decl.c (reshape_init): Adjust call.
	* method.c (forward_parm): Likewise.
	(build_comparison_op): Likewise.
	* pt.c (tsubst_copy_and_build): Likewise.
	* semantics.c (finish_omp_reduction_clause): Likewise.
	(cp_omp_finish_iterators): Likewise.
	* tree.c (cp_stabilize_reference): Likewise.
	(move): Likewise.
	* typeck2.c (build_functional_cast): Likewise.

	* typeck2.c (build_functional_cast_1): New.
	(build_functional_cast_1): Calls the latter and sets the location
	of the returned tree.

/libcc1
2019-12-09  Paolo Carlini  <paolo.carlini@oracle.com>

	* libcp1plugin.cc (plugin_build_cast_expr): Adjust build_cast
	declaration.

gcc/testsuite
2019-12-09  Paolo Carlini  <paolo.carlini@oracle.com>

	* c-c++-common/Wcast-align.c: Check location(s) too.
	* c-c++-common/Wcast-function-type.c: Likewise.
	* c-c++-common/Wint-to-pointer-cast-1.c: Likewise.
	* c-c++-common/Wint-to-pointer-cast-2.c: Likewise.
	* c-c++-common/Wint-to-pointer-cast-3.c: Likewise.
	* g++.dg/Wcast-function-type.C: Likewise.
	* g++.dg/addr_builtin-1.C: Likewise.
	* g++.dg/conversion/const2.C: Likewise.
	* g++.dg/conversion/dynamic1.C: Likewise.
	* g++.dg/conversion/ptrmem2.C: Likewise.
	* g++.dg/conversion/ptrmem3.C: Likewise.
	* g++.dg/conversion/qual3.C: Likewise.
	* g++.dg/conversion/reinterpret3.C: Likewise.
	* g++.dg/cpp0x/constexpr-cast.C: Likewise.
	* g++.dg/cpp0x/lambda/lambda-conv11.C: Likewise.
	* g++.dg/cpp0x/nullptr04.C: Likewise.
	* g++.dg/cpp0x/reinterpret_cast2.C: Likewise.
	* g++.dg/cpp0x/rv-cast2.C: Likewise.
	* g++.dg/cpp1y/lambda-conv1.C: Likewise.
	* g++.dg/cpp1z/noexcept-type7.C: Likewise.
	* g++.dg/cpp2a/array-conv9.C: Likewise.
	* g++.dg/expr/cast11.C: Likewise.
	* g++.dg/expr/static_cast8.C: Likewise.
	* g++.dg/ext/vector6.C: Likewise.
	* g++.dg/other/conversion1.C: Likewise.
	* g++.dg/parse/pr26997.C: Likewise.
	* g++.dg/rtti/no-rtti.C: Likewise.
	* g++.dg/tc1/dr137.C: Likewise.
	* g++.dg/template/cast4.C: Likewise.
	* g++.dg/warn/Wcast-qual1.C: Likewise.
	* g++.dg/warn/Wcast-qual2.C: Likewise.
	* g++.dg/warn/Wconditionally-supported-1.C: Likewise.
	* g++.dg/warn/Wuseless-cast.C: Likewise.
	* g++.dg/warn/pr35711.C: Likewise.
	* g++.old-deja/g++.bugs/900227_01.C: Likewise.
	* g++.old-deja/g++.bugs/900404_07.C: Likewise.
	* g++.old-deja/g++.jason/overload1.C: Likewise.
	* g++.old-deja/g++.jason/rfg26.C: Likewise.
	* g++.old-deja/g++.jason/rvalue3.C: Likewise.
	* g++.old-deja/g++.jason/warning2.C: Likewise.
	* g++.old-deja/g++.mike/dyncast4.C: Likewise.
	* g++.old-deja/g++.mike/dyncast6.C: Likewise.
	* g++.old-deja/g++.mike/p11482.C: Likewise.
	* g++.old-deja/g++.mike/p2573.C: Likewise.
	* g++.old-deja/g++.mike/p2855.C: Likewise.
	* g++.old-deja/g++.mike/p7476.C: Likewise.
	* g++.old-deja/g++.mike/p8039.C: Likewise.
	* g++.old-deja/g++.other/cast2.C: Likewise.
	* g++.old-deja/g++.other/cast3.C: Likewise.
	* g++.old-deja/g++.other/dcast1.C: Likewise.
	* g++.old-deja/g++.other/dcast2.C: Likewise.

From-SVN: r279138
2019-12-09 20:28:39 +00:00
Paolo Carlini
ad774d0d63 typeck2.c (build_functional_cast): Add location_t parameter and use it.
/gcc/cp
2019-12-05  Paolo Carlini  <paolo.carlini@oracle.com>

	* typeck2.c (build_functional_cast): Add location_t parameter
	and use it.
	* cp-tree.h: Update declaration.
	* parser.c (cp_parser_functional_cast): Adjust call.
	* call.c (build_op_delete_call): Likewise.
	(build_new_method_call_1): Likewise.
	* decl.c (check_initializer): Likewise.
	* pt.c (tsubst_copy_and_build): Likewise.
	* semantics.c (finish_compound_literal): Likewise.

/libcc1
2019-12-05  Paolo Carlini  <paolo.carlini@oracle.com>

	* libcp1plugin.cc (plugin_build_expression_list_expr): Adjust
	build_functional_cast call.

/testsuite
2019-12-05  Paolo Carlini  <paolo.carlini@oracle.com>

	* g++.dg/diagnostic/functional-cast-to-array-type-1.C: New.
	* g++.dg/cpp0x/auto25.C: Check location(s) too.
	* g++.dg/cpp0x/auto28.C: Likewise.
	* g++.dg/init/reference2.C: Likewise.
	* g++.dg/parse/template2.C: Likewise.
	* g++.dg/template/error8.C: Likewise.
	* g++.old-deja/g++.ns/crash3.C: Likewise.
	* g++.old-deja/g++.ns/template7.C: Likewise.
	* g++.old-deja/g++.pt/crash8.C: Likewise.

From-SVN: r278987
2019-12-05 08:59:24 +00:00
Paolo Carlini
3554d8ffc5 typeck.c (cp_build_indirect_ref_1): Add location_t parameter and use it in error messages.
/gcc
2019-11-25  Paolo Carlini  <paolo.carlini@oracle.com>

	* typeck.c (cp_build_indirect_ref_1): Add location_t parameter
	and use it in error messages.
	(build_x_indirect_ref): Adjust call.
	(build_indirect_ref): Likewise.
	(cp_build_fold_indirect_ref): Likewise.
	(cp_build_array_ref): Likewise.
	* call.c (build_new_op_1): Likewise.
	* semantics.c (finish_omp_clauses): Likewise.
	(finish_omp_depobj): Likewise.
	* typeck2.c (build_x_arrow): Likewise.
	* cp-tree.h (cp_build_indirect_ref): Update declaration.

	* call.c (build_new_op_1): Use location argument in warning_at.

	* typeck.c (cp_build_modify_expr): Consistently use the
	location_t argument.

/libcc1
2019-11-25  Paolo Carlini  <paolo.carlini@oracle.com>

	* libcp1plugin.cc (plugin_pragma_push_user_expression): Update
	cp_build_indirect_ref call.

/gcc/testsuite
2019-11-25  Paolo Carlini  <paolo.carlini@oracle.com>

	* g++.dg/diagnostic/base-operand-non-pointer-1.C: New.
	* g++.dg/pr53055.C: Check location too.
	* g++.old-deja/g++.bugs/900213_02.C: Likewise.
	* g++.old-deja/g++.bugs/900215_02.C: Likewise.
	* g++.old-deja/g++.other/badarrow.C: Likewise.
	* g++.old-deja/g++.other/deref1.C: Likewise.

	* g++.dg/warn/Wenum-compare.C: Check location too.

	* g++.dg/cpp0x/initlist26.C: Check location too.
	* g++.dg/cpp0x/initlist28.C: Likewise.
	* g++.dg/cpp0x/initlist29.C: Likewise.
	* g++.dg/cpp0x/initlist33.C: Likewise.
	* g++.dg/expr/string-2.C: Likewise.
	* g++.dg/other/ptrmem5.C: Likewise.
	* g++.old-deja/g++.benjamin/14664-1.C: Likewise.
	* g++.old-deja/g++.benjamin/14664-2.C: Likewise.
	* g++.old-deja/g++.brendan/init12.C: Likewise.
	* g++.old-deja/g++.bugs/900324_04.C: Likewise.
	* g++.old-deja/g++.ext/array1.C: Likewise.
	* g++.old-deja/g++.jason/rfg17.C: Likewise.

From-SVN: r278685
2019-11-25 13:49:50 +00:00