C++ PATCH to implement SFINAE for non-constant template arguments

Ulrich Weigand uweigand@de.ibm.com
Thu Jan 20 20:12:00 GMT 2011


Jakub Jelinek wrote:
> On Thu, Jan 20, 2011 at 01:16:03PM +0100, Ulrich Weigand wrote:
> > Jason Merrill wrote:
> > 
> > > --- a/gcc/testsuite/g++.dg/template/char1.C
> > > +++ b/gcc/testsuite/g++.dg/template/char1.C
> > > @@ -1,4 +1,4 @@
> > >  template <class CharType, CharType line_terminator = 0>
> > >  class String {};
> > >  
> > > -String<char, 255> s;
> > > +String<char, 255> s;		// { dg-warning "overflow" }
> > 
> > It seems this causes the test to fail on platforms where "char"
> > is unsigned by default (e.g. spu, powerpc, s390), because there
> > is no warning on such platforms.
> > 
> > Maybe the test can be changed to use explicitly signed or
> > unsigned char variants?
> 
> Or add -fsigned-char to dg-options...

You mean like so?   Note that had to add back the default options,
otherwise all warnings would be disabled either way ...

Bye,
Ulrich

ChangeLog:

	* g++.dg/template/char1.C: Add -fsigned-char to options.


Index: gcc/testsuite/g++.dg/template/char1.C
===================================================================
*** gcc/testsuite/g++.dg/template/char1.C	(revision 168909)
--- gcc/testsuite/g++.dg/template/char1.C	(working copy)
***************
*** 1,3 ****
--- 1,5 ----
+ // { dg-options "-fsigned-char -ansi -pedantic-errors -Wno-long-long" }
+ 
  template <class CharType, CharType line_terminator = 0>
  class String {};
  


-- 
  Dr. Ulrich Weigand
  GNU Toolchain for Linux on System z and Cell BE
  Ulrich.Weigand@de.ibm.com



More information about the Gcc-patches mailing list