On Jun 4, 2012, at 12:30 PM, Jason Merrill wrote: > On 06/04/2012 02:54 PM, Mike Stump wrote: >> Yup, that is truly weird. The problem is that the | operator is binding >> funny because there are no () around the substituted variables in the >> matching expressions in the .exp files, and the messages for a single line >> get the opportunity to match and eat multiple lines. >> >> So, dejagnu is using: >> >> {[0-9]+: error:[^\n]*const|operator} >> >> instead of: >> >> {[0-9]+: error:[^\n]*(const|operator)} >> >> and that makes all the difference. > > That was my guess, too, but when I look at dg.exp it seems that the pattern > is properly wrapped in parens.
That one is, the problem is the work that added error: and warning: processing differentiation puts together a new expression with concatenation and it is that use that _also_ needs protecting. error: CONCAT regexp is wrong, whereas: error: CONCAT (regexp) is correct. This type of patch: - set expmsg "$column: $msgprefix\[^\n\]*$expmsg" + set expmsg "$column: $msgprefix\[^\n\]*($expmsg)" might have been easier to understand, but, that repeats three times and is dependent upon people getting the obscure detail of () correct. I instead add the () at the top, to ensure it is impossible to ever have this error again, no matter the code rearrangements and to have it appear just once, instead of three times. Possibly: - set expmsg [lindex $newentry 2] + set expmsg "([lindex $newentry 2])" might be better...