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]

[C++ Patch] One more error + error to error + inform and a subtler issue


Hi,

today I noticed the below while I was putting together another batch of minor diagnostic fixes. The error + error to error + inform change seems rather straightforward to me and as usual adds clarity to the diagnostic outputs (all the front-ends I have at hand either do something similar or do not output the inform part at all). However, there is a subtler issue. For example the first pair of errors we currently output for constexpr-specialization.C is the following (I'm removing original code and carets for clarity):

constexpr-specialization.C:7:26: error: redeclaration âconstexpr int foo(T) [with T = int]â differs in âconstexprâ

constexpr-specialization.C:6:16: error: from previous declaration âconstexpr int foo(T) [with T = int]â

see? The pretty printing of the previous declaration is very misleading because it has constexpr in it! The same happens for the dual type of error. Now, I suppose we should investigate that a bit more, I don't think it's the first time we notice this, but I'm wondering if for the time being we could just apply something like the below, which just does away with the prettyprinting for the inform, just uses "previous declaration here", something that in any case we already do in a number of places...

Thanks,
Paolo.

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

Attachment: patch_error_inform
Description: Text document


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