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] PR 44516


Hi,

On 05/16/2012 05:41 PM, Jason Merrill wrote:
On 05/16/2012 06:54 AM, Paolo Carlini wrote:
isn't the diagnostic machinery able to cope with UNKNOWN_LOCATION? By
default should be interpreted as input_location, no?
That would make sense to me; I don't know if it works that way now, though.
So, in the meanwhile we learned that it doesn't.

I also carried out a simple practical experiment where I hacked my on going work 53371 and changed its "error (" to an "error_at (UNKNOWN_LOCATION, " and this is the change: this:

53371.C: In function âint main()â:
53371.C:11:15: error: cannot catch exceptions by rvalue reference
   } catch (int&&) { }
               ^

(the caret is below the first &, good enough, I guess) becomes:

In function âint main()â:
cc1plus: error: cannot catch exceptions by rvalue reference

totally broken. Thus, it remains to decide whether we want to guard against this with something local to the build_x_* functions, like my LOC_OR_HERE trick, or with something like the patchlet p1 which I'm attaching below. Just let me know.

@@ -11968,7 +11968,8 @@ tsubst_qualified_id (tree qualified_id, tree args,
if (dependent_scope_p (scope))
{
if (is_template)
- expr = build_min_nt (TEMPLATE_ID_EXPR, expr, template_args);
+ expr = build_min_nt_loc (UNKNOWN_LOCATION, TEMPLATE_ID_EXPR,
+ expr, template_args);

Here we should be able to retain the location from the TEMPLATE_ID_EXPR we took apart earlier.
Ok. Something like p2 below?

We are getting close... ;)

Thanks,
Paolo.

//////////////////////////

Attachment: p1
Description: Text document

Attachment: p2
Description: Text document


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