This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: C++ PATCH for c++/57891, narrowing conversions in non-type template arguments


On Fri, Sep 07, 2018 at 01:40:53PM +0100, Jason Merrill wrote:
> > 2018-08-13  Marek Polacek  <polacek@redhat.com>
> >
> >         PR c++/57891
> >         * call.c (struct conversion): Add check_narrowing_const_only.
> >         (build_converted_constant_expr): Set check_narrowing and
> >         check_narrowing_const_only.  Give error if expr is error node.
> >         (convert_like_real): Pass it to check_narrowing.
> >         * cp-tree.h (check_narrowing): Add a default parameter.
> >         * decl.c (compute_array_index_type): Use input_location instead of
> >         location_of.
> >         * pt.c (convert_nontype_argument): Return NULL_TREE if tf_error.
> >         * typeck2.c (check_narrowing): Don't warn for instantiation-dependent
> >         expressions.  Call maybe_constant_value instead of
> >         fold_non_dependent_expr.  Don't mention { } in diagnostic.  Only check
> >         narrowing for constants if CONST_ONLY.
> 
> This seems to have broken cpp1z/direct-enum-init1.C with -std=c++17
> and above; please use make check-c++-all (or set
> GXX_TESTSUITE_STDS=98,11,14,17,2a) to test C++ patches in all
> conformance modes.

Sorry about that, I've updated my testing and will fix it shortly.

Marek


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]