This is the mail archive of the 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/C++] PR 13358 long long and C++ do not mix well

2009/4/20 Mark Mitchell <>:
> Manuel López-Ibáñez wrote:
> which matches anything, and which I agree is sloppy (though I added
> plenty such tests over the years) and putting the entire text there.
> It's generally possible to pick out a few key words from the error
> message ("invalid overload" or "does not match" or "private" or some
> such) that are the important part of the error message.

If one changes a message and there are not testsuite changes, then one
cannot know whether this message is actually ever tested. If no
testcase is added, then the feature may go untested. If one adds
another testcase, then we may have two equivalent testcases for the
same thing. The latter happens already in the g++.dg and g++.old-deja

If there is one important keyword only, your proposal is reasonable
but if there are several important keywords, then the choices are to
use "\[^\n\]*", which is ugly to read and awful to search/replace, or
use "|", which matches more than we want to match.

For example, if you look at this pattern:

-  i = 18446744073709551615; /* { dg-warning "decimal
constant|unsigned" "decimal constant" } */

you cannot tell which error message is matched. In fact, it turns out
that there are two messages for this line:

+  i = 18446744073709551615; /* { dg-warning "integer constant is so
large that it is unsigned" "decimal constant" } */
+  /* { dg-warning "this decimal constant would be unsigned in ISO
C90" "decimal constant" { target *-*-* } 28 } */

One mentions C90 (but it will still pass if it mentioned C++ or C++0x
or pascal) and the other not. In this case, probably the first message
is redundant but if it were important, we can lose it and it will
never be noticed. We could also lose the second message and the test
will still pass. On the other hand, perhaps the intention was to match
only the second message and the redundant one may have appeared
without anyone noticing.

Moreover, I just noticed that in the g++ testcase I am using:

+  x1 = 0x1b27da572ef3cd86LL; // { dg-warning "long long" }

which is not actually testing that CPP is printing:

     warning: use of C++0x long long integer constant

instead of:

    warning: use of C99 long long integer constant

So this feature may regress in the future without anyone noticing.

>> Nonetheless, you are the maintainer, so if you want me to cut the test
>> pattern, tell me what I should match and I will update the patch.
> I'm not going to make you change a perfectly good patch just for this.
> But, unless Jason/Nathan indicate otherwise, I'd appreciate it if for
> future patches you take a more circumspect approach.

OK, I'll try, less work for me. But if I err on the side of
specificity rather than generality, feel free to ask for changes.



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