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] Improve grokfndecl locations


On Tue, Jun 19, 2018 at 4:55 PM, Paolo Carlini <paolo.carlini@oracle.com> wrote:
> Hi,
>
> the below implements a couple of independent ideas. First, adds a const
> cp_decl_specifier_seq * parameter, similarly to grokvardecl: this way the
> function has available locations[ds_inline], locations[ds_constexpr],
> locations[ds_type_spec] which can use in some error messages. Second, the
> handling of an UNKNOWN_LOCATION as location_t argument is reworked a bit -
> in particular the "deprecated" build_lang_decl call is changed to
> build_lang_decl_loc: everything I already tweaked in the function about
> locations should be now 100% correct + the use of the location_t argument
> can be safely extended to a couple of additional places. Tested
> x86_64-linux.

>+       error_at (location,
>+                 "default arguments are not allowed in declaration "
>+                 "of friend template specialization %qD",
>+                 decl);

You can use defarg_location (or location_of) for the location of a
default argument.  OK with that change.

Jason


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