Commit Graph

98 Commits

Author SHA1 Message Date
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
Maciej W. Rozycki e9085da528 Regenerate `configure' scripts for `uclinuxfdpiceabi' libtool.m4 update
A change made with r275564 ("[ARM/FDPIC v6 02/24] [ARM] FDPIC: Handle 
arm*-*-uclinuxfdpiceabi in configure scripts") to libtool.m4 has not 
regenerated all the `configure' scripts affected.  Fix it.

	gcc/
	* configure: Regenerate.

	libatomic/
	* configure: Regenerate.

	libbacktrace/
	* configure: Regenerate.

	libcc1/
	* configure: Regenerate.

	libffi/
	* configure: Regenerate.

	libgfortran/
	* configure: Regenerate.

	libgomp/
	* configure: Regenerate.

	libhsail-rt/
	* configure: Regenerate.

	libitm/
	* configure: Regenerate.

	libobjc/
	* configure: Regenerate.

	liboffloadmic/
	* configure: Regenerate.

	libphobos/
	* configure: Regenerate.

	libquadmath/
	* configure: Regenerate.

	libsanitizer/
	* configure: Regenerate.

	libssp/
	* configure: Regenerate.

	libstdc++-v3/
	* configure: Regenerate.

	libvtv/
	* configure: Regenerate.

	lto-plugin/
	* configure: Regenerate.

	zlib/
	* configure: Regenerate.

From-SVN: r276213
2019-09-27 21:24:42 +00:00
Nathan Sidwell 692af872fa [C++ PATCH] Using decls
https://gcc.gnu.org/ml/gcc-patches/2019-05/msg01396.html
	gcc/cp/
	* name-lookup.h (struct cp_binding_level): Drop usings field.
	(finish_namespace_using_decl, finish_local_using_decl): Replace with ...
	(finish_nonmember_using_decl): ... this.
	* name-lookup.c (push_using_decl_1, push_using_decl):
	(do_nonmember_using_decl): ... here.  Add INSERT_P arg.  Reimplement.
	(validate_nonmember_using_decl, finish_namespace_using_decl)
	(finish_local_using_decl): Replace with ...
	(finish_nonmember_using_decl): ... this.  Drop DECL parm.
	* parser.c (cp_parser_using_declaration): Don't do lookup here.
	* pt.c (tsubst_expr): Do not do using decl lookup here.

	gcc/testsuite/
	* g++.dg/lookup/using53.C: Adjust diagnostic.

	libcc1/
	* libcp1plugin.cc (plugin_add_using_decl): Use
	finish_nonmember_using_decl.

From-SVN: r271467
2019-05-21 14:33:24 +00:00
Nathan Sidwell 6db76e48c1 [C++ PATCH] Commonixe using directive finishing
https://gcc.gnu.org/ml/gcc-patches/2019-05/msg01251.html
	gcc/cp/
	* name-lookup.c (finish_namespace_using_directive)
	(finish_local_using_directive): Merge to ...
	(finish_using_directive): ... here.  Handle both contexts.
	* name-lookup.h (finish_namespace_using_directive)
	(finish_local_using_directive): Replace with ...
	(finish_using_directive): ... this.
	* parser.c (cp_parser_using_directive): Adjust.
	* pt.c (tsubst_expr): Likewise.

	libcc1/
	* libcp1plugin.cc (plugin_add_using_namespace): Call renamed
	finish_using_directive.

From-SVN: r271420
2019-05-20 13:49:53 +00:00
Jakub Jelinek a554497024 Update copyright years.
From-SVN: r267494
2019-01-01 13:31:55 +01:00
David Malcolm 620e594be5 Eliminate source_location in favor of location_t
Historically GCC used location_t, while libcpp used source_location.

This inconsistency has been annoying me for a while, so this patch
removes source_location in favor of location_t throughout
(as the latter is shorter).

gcc/ChangeLog:
	* builtins.c: Replace "source_location" with "location_t".
	* diagnostic-show-locus.c: Likewise.
	* diagnostic.c: Likewise.
	* dumpfile.c: Likewise.
	* gcc-rich-location.h: Likewise.
	* genmatch.c: Likewise.
	* gimple.h: Likewise.
	* gimplify.c: Likewise.
	* input.c: Likewise.
	* input.h: Likewise.  Eliminate the typedef.
	* omp-expand.c: Likewise.
	* selftest.h: Likewise.
	* substring-locations.h (get_source_location_for_substring):
	Rename to..
	(get_location_within_string): ...this.
	* tree-cfg.c: Replace "source_location" with "location_t".
	* tree-cfgcleanup.c: Likewise.
	* tree-diagnostic.c: Likewise.
	* tree-into-ssa.c: Likewise.
	* tree-outof-ssa.c: Likewise.
	* tree-parloops.c: Likewise.
	* tree-phinodes.c: Likewise.
	* tree-phinodes.h: Likewise.
	* tree-ssa-loop-ivopts.c: Likewise.
	* tree-ssa-loop-manip.c: Likewise.
	* tree-ssa-phiopt.c: Likewise.
	* tree-ssa-phiprop.c: Likewise.
	* tree-ssa-threadupdate.c: Likewise.
	* tree-ssa.c: Likewise.
	* tree-ssa.h: Likewise.
	* tree-vect-loop-manip.c: Likewise.

gcc/c-family/ChangeLog:
	* c-common.c (c_get_substring_location): Update for renaming of
	get_source_location_for_substring to get_location_within_string.
	* c-lex.c: Replace "source_location" with "location_t".
	* c-opts.c: Likewise.
	* c-ppoutput.c: Likewise.

gcc/c/ChangeLog:
	* c-decl.c: Replace "source_location" with "location_t".
	* c-tree.h: Likewise.
	* c-typeck.c: Likewise.
	* gimple-parser.c: Likewise.

gcc/cp/ChangeLog:
	* call.c: Replace "source_location" with "location_t".
	* cp-tree.h: Likewise.
	* cvt.c: Likewise.
	* name-lookup.c: Likewise.
	* parser.c: Likewise.
	* typeck.c: Likewise.

gcc/fortran/ChangeLog:
	* cpp.c: Replace "source_location" with "location_t".
	* gfortran.h: Likewise.

gcc/go/ChangeLog:
	* go-gcc-diagnostics.cc: Replace "source_location" with "location_t".
	* go-gcc.cc: Likewise.
	* go-linemap.cc: Likewise.
	* go-location.h: Likewise.
	* gofrontend/README: Likewise.

gcc/jit/ChangeLog:
	* jit-playback.c: Replace "source_location" with "location_t".

gcc/testsuite/ChangeLog:
	* g++.dg/plugin/comment_plugin.c: Replace "source_location" with
	"location_t".
	* gcc.dg/plugin/diagnostic_plugin_test_show_locus.c: Likewise.

libcc1/ChangeLog:
	* libcc1plugin.cc: Replace "source_location" with "location_t".
	(plugin_context::get_source_location): Rename to...
	(plugin_context::get_location_t): ...this.
	* libcp1plugin.cc: Likewise.

libcpp/ChangeLog:
	* charset.c: Replace "source_location" with "location_t".
	* directives-only.c: Likewise.
	* directives.c: Likewise.
	* errors.c: Likewise.
	* expr.c: Likewise.
	* files.c: Likewise.
	* include/cpplib.h: Likewise.  Rename MAX_SOURCE_LOCATION to
	MAX_LOCATION_T.
	* include/line-map.h: Likewise.
	* init.c: Likewise.
	* internal.h: Likewise.
	* lex.c: Likewise.
	* line-map.c: Likewise.
	* location-example.txt: Likewise.
	* macro.c: Likewise.
	* pch.c: Likewise.
	* traditional.c: Likewise.

From-SVN: r266085
2018-11-13 20:05:03 +00:00
Joseph Myers 22e0527251 Update GCC to autoconf 2.69, automake 1.15.1 (PR bootstrap/82856).
This patch updates GCC to use autoconf 2.69 and automake 1.15.1.
(That's not the latest automake version, but it's the one used by
binutils-gdb, with which consistency is desirable, and in any case
seems a useful incremental update that should make a future update to
1.16.1 easier.)

The changes are generally similar to the binutils-gdb ones, and are
copied from there where shared files and directories are involved
(there are some further changes to such shared directories, however,
which I'd expect to apply to binutils-gdb once this patch is in GCC).
Largely, obsolete AC_PREREQ calls are removed, while many
AC_LANG_SOURCE calls are added to avoid warnings from aclocal and
autoconf.  Multilib support is no longer included in core automake,
meaning that multilib.am needs copying from automake's contrib
directory into the GCC source tree.  Autoconf 2.69 has Go support, so
local copies of that support are removed.  I hope the D support will
soon be submitted to upstream autoconf so the local copy of that can
be removed in a future update.  Changes to how automake generates
runtest calls mean quotes are removed from RUNTEST definitions in five
lib*/testsuite/Makefile.am files (libatomic, libgomp, libitm,
libphobos, libvtv; some others have RUNTEST definitions without
quotes, which are still OK); libgo and libphobos also get
-Wno-override added to AM_INIT_AUTOMAKE so those overrides of RUNTEST
do not generate automake warnings.

Note that the regeneration did not include regeneration of
fixincludes/config.h.in (attempting such regeneration resulted in all
the USED_FOR_TARGET conditionals disappearing; and I don't see
anything in the fixincludes/ directory that would result in such
conditionals being generated, unlike in the gcc/ directory).  Also
note that libvtv/testsuite/other-tests/Makefile.in was not
regenerated; that directory is not listed as a subdirectory for which
Makefile.in gets regenerated by calling "automake" in libvtv/, so I'm
not sure how it's meant to be regenerated.

While I mostly fixed warnings should running aclocal / automake /
autoconf, there were various such warnings from automake in the
libgfortran, libgo, libgomp, liboffloadmic, libsanitizer, libphobos
directories that I did not fix, preferring to leave those to the
relevant subsystem maintainers.  Specifically, most of those warnings
were of the following form (example from libgfortran):

Makefile.am:48: warning: source file 'caf/single.c' is in a subdirectory,
Makefile.am:48: but option 'subdir-objects' is disabled
automake: warning: possible forward-incompatibility.
automake: At least a source file is in a subdirectory, but the 'subdir-objects'
automake: automake option hasn't been enabled.  For now, the corresponding output
automake: object file(s) will be placed in the top-level directory.  However,
automake: this behaviour will change in future Automake versions: they
will
automake: unconditionally cause object files to be placed in the same subdirectory
automake: of the corresponding sources.
automake: You are advised to start using 'subdir-objects' option throughout your
automake: project, to avoid future incompatibilities.

I think it's best for the relevant maintainers to add subdir-objects
and do any other associated Makefile.am changes needed.  In some cases
the paths in the warnings involved ../; I don't know if that adds any
extra complications to the use of subdir-objects.

I've tested this with native, cross and Canadian cross builds.  The
risk of any OS-specific issues should I hope be rather lower than if a
libtool upgrade were included (we *should* do such an upgrade at some
point, but it's more complicated - it involves identifying all our
local libtool changes to see if any aren't included in the upstream
version we update to, and reverting an upstream libtool patch that's
inappropriate for use in GCC); I think it would be better to get this
update into GCC so that people can test in different configurations
and we can fix any issues found, rather than to try to get more and
more testing done before it goes in.

top level:
2018-10-31  Joseph Myers  <joseph@codesourcery.com>

	PR bootstrap/82856
	* multilib.am: New file.  From automake.

	Merge from binutils-gdb:
	2018-06-19  Simon Marchi  <simon.marchi@ericsson.com>

	* libtool.m4: Use AC_LANG_SOURCE.
	* configure.ac: Remove AC_PREREQ, use AC_LANG_SOURCE.
	* ar-lib: New file.
	* test-driver: New file.
	* configure: Re-generate.

config:
2018-10-31  Joseph Myers  <joseph@codesourcery.com>

	PR bootstrap/82856
	* math.m4, tls.m4: Use AC_LANG_SOURCE.

	Merge from binutils-gdb:
	2018-06-19  Simon Marchi  <simon.marchi@ericsson.com>

	* override.m4 (_GCC_AUTOCONF_VERSION): Bump from 2.64 to 2.69.

fixincludes:
2018-10-31  Joseph Myers  <joseph@codesourcery.com>

	PR bootstrap/82856
	* configure.ac: Remove AC_PREREQ.
	* aclocal.m4, configure: Regenerate.

gcc:
2018-10-31  Joseph Myers  <joseph@codesourcery.com>

	PR bootstrap/82856
	* configure.ac: Remove AC_PREREQ.  Use AC_LANG_SOURCE.  Use single
	line for second argument of AC_DEFINE_UNQUOTED.
	* doc/install.texi (Tools/packages necessary for modifying GCC):
	Update to autoconf 2.69 and automake 1.15.1.
	* aclocal.m4, config.in, configure: Regenerate.

gnattools:
2018-10-31  Joseph Myers  <joseph@codesourcery.com>

	PR bootstrap/82856
	* configure.ac: Remove AC_PREREQ.
	* configure: Regenerate.

gotools:
2018-10-31  Joseph Myers  <joseph@codesourcery.com>

	PR bootstrap/82856
	* config/go.m4: Remove file.
	* Makefile.am (ACLOCAL_AMFLAGS): Do not use -I ./config.
	* configure.ac:  Remove AC_PREREQ.  Do not include config/go.m4.
	* Makefile.in, aclocal.m4, configure: Regenerate.

intl:
2018-10-31  Joseph Myers  <joseph@codesourcery.com>

	PR bootstrap/82856
	Merge from binutils-gdb:
	2018-06-19  Simon Marchi  <simon.marchi@ericsson.com>

	* configure.ac: Add AC_USE_SYSTEM_EXTENSIONS, remove AC_PREREQ.
	* configure: Re-generate.
	* config.h.in: Re-generate.
	* aclocal.m4: Re-generate.

libada:
2018-10-31  Joseph Myers  <joseph@codesourcery.com>

	PR bootstrap/82856
	* configure.ac: Remove AC_PREREQ.
	* configure: Regenerate.

libatomic:
2018-10-31  Joseph Myers  <joseph@codesourcery.com>

	PR bootstrap/82856
	* Makefile.am: Include multilib.am.
	* acinclude.m4: Use AC_LANG_SOURCE.
	* configure.ac: Remove AC_PREREQ.
	* testsuite/Makefile.am (RUNTEST): Remove quotes.
	* Makefile.in, aclocal.m4, configure, testsuite/Makefile.in:
	Regenerate.

libbacktrace:
2018-10-31  Joseph Myers  <joseph@codesourcery.com>

	PR bootstrap/82856
	* Makefile.am: Include multilib.am.
	* configure.ac: Remove AC_PREREQ.  Use AC_LANG_SOURCE.
	* Makefile.in, aclocal.m4, config.h.in, configure: Regenerate.

libcc1:
2018-10-31  Joseph Myers  <joseph@codesourcery.com>

	PR bootstrap/82856
	* configure.ac: Remove AC_PREREQ.
	* Makefile.in, aclocal.m4, configure: Regenerate.

libcpp:
2018-10-31  Joseph Myers  <joseph@codesourcery.com>

	PR bootstrap/82856
	* configure.ac: Remove AC_PREREQ.  Use AC_LANG_SOURCE.
	* aclocal.m4, config.in, configure: Regenerate.

libdecnumber:
2018-10-31  Joseph Myers  <joseph@codesourcery.com>

	PR bootstrap/82856
	Merge from binutils-gdb:
	2018-06-19  Simon Marchi  <simon.marchi@ericsson.com>

	* configure.ac: Remove AC_PREREQ.
	* configure: Re-generate.
	* aclocal.m4.

libffi:
2018-10-31  Joseph Myers  <joseph@codesourcery.com>

	PR bootstrap/82856
	* Makefile.am: Include multilib.am.
	(AUTOMAKE_OPTIONS): Add info-in-builddir.
	(CLEANFILES): Remove doc/libffi.info.
	* configure.ac: Remove AC_PREREQ.
	* Makefile.in, aclocal.m4, configure, fficonfig.h.in,
	include/Makefile.in, man/Makefile.in, testsuite/Makefile.in:
	Regenerate.

libgcc:
2018-10-31  Joseph Myers  <joseph@codesourcery.com>

	PR bootstrap/82856
	* configure.ac: Remove AC_PREREQ.  Use AC_LANG_SOURCE.
	* configure: Regenerate.

libgfortran:
2018-10-31  Joseph Myers  <joseph@codesourcery.com>

	PR bootstrap/82856
	* Makefile.am: Include multilib.am.
	* configure.ac: Remove AC_PREREQ.
	* Makefile.in, aclocal.m4, config.h.in, configure: Regenerate.

libgo [logically part of this change but omitted from the commit]:
2018-10-31  Joseph Myers  <joseph@codesourcery.com>

	PR bootstrap/82856
	* Makefile.am: Include multilib.am.
	* config/go.m4: Remove file.
	* config/libtool.m4: Use AC_LANG_SOURCE.
	* configure.ac: Remove AC_PREREQ.  Use AC_LANG_SOURCE.  Use
	-Wno-override in AM_INIT_AUTOMAKE call.
	* Makefile.in, aclocal.m4, configure, testsuite/Makefile.in:
	Regenerate.

libgomp:
2018-10-31  Joseph Myers  <joseph@codesourcery.com>

	PR bootstrap/82856
	* Makefile.am: Include multilib.am
	(AUTOMAKE_OPTIONS): Add info-in-builddir.
	(CLEANFILES): Remove libgomp.info.
	* configure.ac: Remove AC_PREREQ.
	* testsuite/Makefile.am (RUNTEST): Remove quotes.
	* Makefile.in, aclocal.m4, configure, testsuite/Makefile.in:
	Regenerate.

libhsail-rt:
2018-10-31  Joseph Myers  <joseph@codesourcery.com>

	PR bootstrap/82856
	* configure.ac: Remove AC_PREREQ.
	* Makefile.in, aclocal.m4, configure: Regenerate.

libiberty:
2018-10-31  Joseph Myers  <joseph@codesourcery.com>

	PR bootstrap/82856
	Merge from binutils-gdb:
	2018-06-19  Simon Marchi  <simon.marchi@ericsson.com>

	* configure.ac: Remove AC_PREREQ.
	* configure: Re-generate.
	* config.in: Re-generate.

libitm:
2018-10-31  Joseph Myers  <joseph@codesourcery.com>

	PR bootstrap/82856
	* Makefile.am: Include multilib.am.
	(AUTOMAKE_OPTIONS): Add info-in-builddir.
	(CLEANFILES): Remove libitm.info.
	* configure.ac: Remove AC_PREREQ.
	* testsuite/Makefile.am (RUNTEST): Remove quotes.
	* Makefile.in, aclocal.m4, configure, testsuite/Makefile.in:
	Regenerate.

libobjc:
2018-10-31  Joseph Myers  <joseph@codesourcery.com>

	PR bootstrap/82856
	* configure.ac: Remove AC_PREREQ.
	* aclocal.m4, config.h.in, configure: Regenerate.

liboffloadmic:
2018-10-31  Joseph Myers  <joseph@codesourcery.com>

	PR bootstrap/82856
	* Makefile.am: Include multilib.am.
	* configure.ac: Remove AC_PREREQ.
	* plugin/Makefile.am: Include multilib.am.
	* plugin/configure.ac: Remove AC_PREREQ.
	* Makefile.in, aclocal.m4, configure, plugin/Makefile.in,
	plugin/aclocal.m4, plugin/configure: Regenerate.

libphobos:
2018-10-31  Joseph Myers  <joseph@codesourcery.com>

	PR bootstrap/82856
	* Makefile.am: Include multilib.am.
	* configure.ac: Remove AC_PREREQ.  Use -Wno-override in
	AM_INIT_AUTOMAKE call.
	* m4/autoconf.m4: Add extra argument to AC_LANG_DEFINE call.
	* m4/druntime/os.m4: Use AC_LANG_SOURCE.
	* testsuite/Makefile.am (RUNTEST): Remove quotes.
	* Makefile.in, aclocal.m4, configure, libdruntime/Makefile.in,
	src/Makefile.in, testsuite/Makefile.in: Regenerate.

libquadmath:
2018-10-31  Joseph Myers  <joseph@codesourcery.com>

	PR bootstrap/82856
	* Makefile.am: Include multilib.am.
	(AUTOMAKE_OPTIONS): Remove 1.8.  Add info-in-builddir.
	(all-local): Define outside conditional code.
	(CLEANFILES): Remove libquadmath.info.
	* configure.ac: Remove AC_PREREQ.
	* Makefile.in, aclocal.m4, config.h.in, configure: Regenerate.

libsanitizer:
2018-10-31  Joseph Myers  <joseph@codesourcery.com>

	PR bootstrap/82856
	* Makefile.am: Include multilib.am.
	* configure.ac: Remove AC_PREREQ.  Use AC_LANG_SOURCE.
	* Makefile.in, aclocal.m4, asan/Makefile.in, configure,
	interception/Makefile.in, libbacktrace/Makefile.in,
	lsan/Makefile.in, sanitizer_common/Makefile.in, tsan/Makefile.in,
	ubsan/Makefile.in: Regenerate.

libssp:
2018-10-31  Joseph Myers  <joseph@codesourcery.com>

	PR bootstrap/82856
	* Makefile.am: Include multilib.am.
	(AUTOMAKE_OPTIONS): Remove 1.9.5.
	* configure.ac: Remove AC_PREREQ.  Quote argument to
	AC_RUN_IFELSE.
	* Makefile.in, aclocal.m4, configure: Regenerate.

libstdc++-v3:
2018-10-31  Joseph Myers  <joseph@codesourcery.com>

	PR bootstrap/82856
	* Makefile.am: Include multilib.am.
	* configure.ac: Remove AC_PREREQ.
	* Makefile.in, aclocal.m4, configure, doc/Makefile.in,
	include/Makefile.in, libsupc++/Makefile.in, po/Makefile.in,
	python/Makefile.in, src/Makefile.in, src/c++11/Makefile.in,
	src/c++17/Makefile.in, src/c++98/Makefile.in,
	src/filesystem/Makefile.in, testsuite/Makefile.in: Regenerate.

libvtv:
2018-10-31  Joseph Myers  <joseph@codesourcery.com>

	PR bootstrap/82856
	* Makefile.am: Include multilib.am.
	* configure.ac: Remove AC_PREREQ.
	* testsuite/Makefile.am (RUNTEST): Remove quotes.
	* Makefile.in, aclocal.m4, configure, testsuite/Makefile.in:
	Regenerate.

lto-plugin:
2018-10-31  Joseph Myers  <joseph@codesourcery.com>

	PR bootstrap/82856
	* configure.ac: Remove AC_PREREQ.  Use AC_LANG_SOURCE.
	* Makefile.in, aclocal.m4, config.h.in, configure: Regenerate.

zlib:
2018-10-31  Joseph Myers  <joseph@codesourcery.com>

	PR bootstrap/82856
	* Makefile.am: Include multilib.am.

	Merge from binutils-gdb:
	2018-06-19  Simon Marchi  <simon.marchi@ericsson.com>

	* configure.ac: Modernize AC_INIT call, remove AC_PREREQ.
	* Makefile.am (AUTOMAKE_OPTIONS): Remove 1.8, cygnus, add foreign.
	* Makefile.in: Re-generate.
	* aclocal.m4: Re-generate.
	* configure: Re-generate.

From-SVN: r265695
2018-10-31 17:03:16 +00:00
Jason Merrill aa2b105511 PR c++/69560 - wrong alignof(double) on x86.
CWG 1879 - Inadequate definition of alignment requirement.
	* cp-tree.h (ALIGNOF_EXPR_STD_P): New.
	* typeck.c (cxx_sizeof_or_alignof_type): Add std_alignof parm.
	(cxx_sizeof_expr, cxx_sizeof_nowarn, cxx_alignas_expr)
	(cxx_alignof_expr): Pass it.
	* parser.c (cp_parser_unary_expression): Pass it.
	* pt.c (tsubst_copy): Copy it.
	(tsubst_copy_and_build): Pass it.
	* decl.c (fold_sizeof_expr): Pass it.

From-SVN: r259578
2018-04-23 16:49:38 -04:00
David Malcolm 001ddaa852 re PR jit/85384 (libgccjit does not work if --with-gcc-major-version is used)
PR jit/85384
	* acx.m4 (GCC_BASE_VER): Remove \$\$ from sed expression.

	* configure.ac (gcc-driver-name.h): Honor --with-gcc-major-version
	by using gcc_base_ver to generate a gcc_driver_version, and use
	it when generating GCC_DRIVER_NAME.
	* configure: Regenerate.

	* configure: Regenerate.

From-SVN: r259462
2018-04-18 11:46:58 +02:00
Jakub Jelinek 85ec4feb11 Update copyright years.
From-SVN: r256169
2018-01-03 11:03:58 +01:00
Boris Kolpackov 8c7dbea9f1 Plugin support on Windows/MinGW
config/ChangeLog:
2017-11-14 Boris Kolpackov  <boris@codesynthesis.com>

	* gcc-plugin.m4: Add support for MinGW.

gcc/ChangeLog:
2017-11-14 Boris Kolpackov  <boris@codesynthesis.com>

	* plugin.c (add_new_plugin): Use platform-specific library extensions.
	(try_init_one_plugin): Alternative implementation for MinGW.
	* Makefile.in (plugin_implib): New.
	(gengtype-lex.c): Fix broken AIX workaround.
	* configure: Regenerate.
	* doc/plugins.texi: Document support for MinGW.

gcc/c/ChangeLog:
2017-11-14 Boris Kolpackov  <boris@codesynthesis.com>

	* Make-lang.in (c.install-plugin): Install backend import library.

gcc/cp/ChangeLog:
2017-11-14 Boris Kolpackov  <boris@codesynthesis.com>

	* Make-lang.in (c++.install-plugin): Install backend import library.

libcc1/ChangeLog:
2017-11-14 Boris Kolpackov  <boris@codesynthesis.com>

	* configure: Regenerate.

From-SVN: r255154
2017-11-26 13:00:48 +00:00