diff mbox series

[C++] Fix udlit-char-template-neg.C test

Message ID 20190522214507.GU7979@redhat.com
State New
Headers show
Series [C++] Fix udlit-char-template-neg.C test | expand

Commit Message

Marek Polacek May 22, 2019, 9:45 p.m. UTC
I noticed this test fails since r271492.  Probably obvious, but...

Tested on x86_64-linux, ok for trunk?

2019-05-22  Marek Polacek  <polacek@redhat.com>

	* g++.dg/cpp1y/udlit-char-template-neg.C: Expect the error on a
	different line.  Check the column number too.

Comments

Paolo Carlini May 22, 2019, 10 p.m. UTC | #1
Hi,

On 22/05/19 23:45, Marek Polacek wrote:
> I noticed this test fails since r271492.  Probably obvious, but...
>
> Tested on x86_64-linux, ok for trunk?

I was wondering why I didn't notice it... It's because it only fails 
with check-c++-all not with check-c++. Anyway, it seems obvious to me 
too and the right line is the current one, good ;)

Paolo.
Marek Polacek May 22, 2019, 10:04 p.m. UTC | #2
On Thu, May 23, 2019 at 12:00:22AM +0200, Paolo Carlini wrote:
> Hi,
> 
> On 22/05/19 23:45, Marek Polacek wrote:
> > I noticed this test fails since r271492.  Probably obvious, but...
> > 
> > Tested on x86_64-linux, ok for trunk?
> 
> I was wondering why I didn't notice it... It's because it only fails with
> check-c++-all not with check-c++. Anyway, it seems obvious to me too and the
> right line is the current one, good ;)

I'll go ahead and check it in, thanks for confirming!

Marek
Paolo Carlini May 22, 2019, 10:11 p.m. UTC | #3
Hi,

On 23/05/19 00:04, Marek Polacek wrote:
> On Thu, May 23, 2019 at 12:00:22AM +0200, Paolo Carlini wrote:
>> Hi,
>>
>> On 22/05/19 23:45, Marek Polacek wrote:
>>> I noticed this test fails since r271492.  Probably obvious, but...
>>>
>>> Tested on x86_64-linux, ok for trunk?
>> I was wondering why I didn't notice it... It's because it only fails with
>> check-c++-all not with check-c++. Anyway, it seems obvious to me too and the
>> right line is the current one, good ;)
> I'll go ahead and check it in, thanks for confirming!

Actually, Marek, there is a vey weird issue with our DejaGNU 
infrastructure which I noticed already in the past: dg-error "3:literal 
operator template|has invalid parameter list" is unexpectedly very weak: 
the column information, the 3, due to the | is mysteriously ignored. I 
think you want to shorten the string literal to simply "3:literal 
operator template", or alternately specify everything up to the "has 
invalid parameter list" (ie, see what I did for that patch and many other).

Paolo.
Marek Polacek May 22, 2019, 10:54 p.m. UTC | #4
On Thu, May 23, 2019 at 12:11:24AM +0200, Paolo Carlini wrote:
> Hi,
> 
> On 23/05/19 00:04, Marek Polacek wrote:
> > On Thu, May 23, 2019 at 12:00:22AM +0200, Paolo Carlini wrote:
> > > Hi,
> > > 
> > > On 22/05/19 23:45, Marek Polacek wrote:
> > > > I noticed this test fails since r271492.  Probably obvious, but...
> > > > 
> > > > Tested on x86_64-linux, ok for trunk?
> > > I was wondering why I didn't notice it... It's because it only fails with
> > > check-c++-all not with check-c++. Anyway, it seems obvious to me too and the
> > > right line is the current one, good ;)
> > I'll go ahead and check it in, thanks for confirming!
> 
> Actually, Marek, there is a vey weird issue with our DejaGNU infrastructure
> which I noticed already in the past: dg-error "3:literal operator
> template|has invalid parameter list" is unexpectedly very weak: the column
> information, the 3, due to the | is mysteriously ignored. I think you want
> to shorten the string literal to simply "3:literal operator template", or
> alternately specify everything up to the "has invalid parameter list" (ie,
> see what I did for that patch and many other).

I see, thanks.  I'm checking in this, then: 

2019-05-22  Marek Polacek  <polacek@redhat.com>

	* g++.dg/cpp1y/udlit-char-template-neg.C: Expect the error on a
	different line.  Check the column number too.

diff --git gcc/testsuite/g++.dg/cpp1y/udlit-char-template-neg.C gcc/testsuite/g++.dg/cpp1y/udlit-char-template-neg.C
index e77ea45890d..6295256b53d 100644
--- gcc/testsuite/g++.dg/cpp1y/udlit-char-template-neg.C
+++ gcc/testsuite/g++.dg/cpp1y/udlit-char-template-neg.C
@@ -2,7 +2,7 @@
 
 template<typename CharT, CharT... String>
   int
-  operator"" _script()
-  { return 42; } // { dg-error "literal operator template|has invalid parameter list" }
+  operator"" _script() // { dg-error "3:literal operator template" }
+  { return 42; }
 
 int i = "hi!"_script;
diff mbox series

Patch

diff --git gcc/testsuite/g++.dg/cpp1y/udlit-char-template-neg.C gcc/testsuite/g++.dg/cpp1y/udlit-char-template-neg.C
index e77ea45890d..6295256b53d 100644
--- gcc/testsuite/g++.dg/cpp1y/udlit-char-template-neg.C
+++ gcc/testsuite/g++.dg/cpp1y/udlit-char-template-neg.C
@@ -2,7 +2,7 @@ 
 
 template<typename CharT, CharT... String>
   int
-  operator"" _script()
-  { return 42; } // { dg-error "literal operator template|has invalid parameter list" }
+  operator"" _script() // { dg-error "3:literal operator template|has invalid parameter list" }
+  { return 42; }
 
 int i = "hi!"_script;