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] Prefer error + inform to two errors in check_template_shadow


Hi,

On 07/14/2015 05:07 PM, Jason Merrill wrote:
On 07/13/2015 09:41 AM, Paolo Carlini wrote:
+++ testsuite/g++.dg/template/crash81.C (working copy)
@@ -3,6 +3,6 @@
  struct A
  {
template<T::X> struct X; // { dg-error "'T' has not been declared" "T" } - // { dg-error "declaration of 'template<int X> struct A::X'" "A::X" { target *-*-* } 5 } - // { dg-error "shadows template parm 'int X'" "shadow" { target *-*-* } 5 } + // { dg-error "declaration of 'template<int X> struct A::X' shadows" "A::X" { target *-*-* } 5 }
+  // { dg-message "template parameter 'X'" "" { target *-*-* } 5 }

I don't see any reason to check for specific diagnostics here; the latter two messages are poor error-recovery, not something to test for.
Indeed, I noticed the error recovery issue, which I didn't know, and considered looking into it, when I'm done with some other things. In the meanwhile I'm shortening the expected error/inform.

Thanks,
Paolo.


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