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: [patch] Fix PR16806, error-recovery on the 3.3 branch


Volker Reichelt <reichelt@igpm.rwth-aachen.de> writes:

| When trying to produce an error message for the following invalid code
| snippet the 3.3 branch compiler gets hiccups:
| 
| -----------------------------------
| struct A
| {
|     template<int> int foo();
| };
| 
| void operator << (const A&, int);
| 
| void bar()
| {
|     A() << A().foo<0>;
| }
| -----------------------------------
| 
| bug.cc: In function `void bar()':
| bug.cc:10: error: no match for 'operator<<' in 'A() << 
| Internal compiler error: Error reporting routines re-entered.
| Please submit a full bug report, [etc.]
| 
| This is because we fail to print the name of the template function
| in dump_expr in cp/error.c.
| 
| The following patch fixes that by recursing into dump_expr (backported
| from mainline). With this patch I now get:
| 
| bug.cc: In function `void bar()':
| bug.cc:10: error: no match for 'operator<<' in 'A() << A().foo<0>'
| bug.cc:6: error: candidates are: void operator<<(const A&, int)
| 
| Bootstrapped and regtested on i686-pc-linux-gnu.
| 
| Ok to apply to the 3.3 branch?

Sweet! I like one-liner patch fix bugs :-)

Yes, please.

(I did make an announcement about the status of 3.3.6, but it seems
not to have made it to the list...)

-- Gaby


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