On Tue, Jun 19, 2018 at 4:55 PM, Paolo Carlini <paolo.carl...@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