https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79064

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jakub at gcc dot gnu.org

--- Comment #8 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
It fails on i686-linux too, I bet pretty much all ILP32 targets.
So, either we can go for something like:
--- gcc/testsuite/g++.dg/template/overload15.C.jj       2018-02-16
23:37:28.682364104 +0100
+++ gcc/testsuite/g++.dg/template/overload15.C  2018-02-19 19:42:39.408037955
+0100
@@ -1,11 +1,17 @@
 // PR c++79064 - Cannot overload member function templates on type of literal
 // { dg-do compile }

+#if __SIZEOF_LONG_LONG__ > __SIZEOF_INT__
 template <unsigned N>
 void f (char (*)[0u - 1 > N ? 1 : 7]);

+#if __SIZEOF_LONG__ > __SIZEOF_INT__
 template <unsigned N>
 void f (char (*)[0u - 1l > N ? 1 : 7]);
+#else
+template <unsigned N>
+void f (char (*)[0u - 1ll > N ? 1 : 7]);
+#endif

 void f ()
 {
@@ -14,3 +20,6 @@ void f ()
   f<0>(&x);
   f<0>(&y);
 }
+#else
+int i;
+#endif

or, assuming on all targets we support long long is wider than int (I think
that is the case on all current targets) just a simple:
2018-02-19  Jakub Jelinek  <ja...@redhat.com>

        PR c++/79064
        * g++.dg/template/overload15.C (f): Use 0u - 1ll instead of 0u - 1l.

--- gcc/testsuite/g++.dg/template/overload15.C.jj       2018-02-16
23:37:28.682364104 +0100
+++ gcc/testsuite/g++.dg/template/overload15.C  2018-02-19 19:45:48.771094113
+0100
@@ -5,7 +5,7 @@ template <unsigned N>
 void f (char (*)[0u - 1 > N ? 1 : 7]);

 template <unsigned N>
-void f (char (*)[0u - 1l > N ? 1 : 7]);
+void f (char (*)[0u - 1ll > N ? 1 : 7]);

 void f ()
 {

which I'll commit momentarily.
Even on x86_64-linux, you should have spotted when adding the testcase,
make check-c++-all RUNTESTFLAGS='--target_board=unix\{-m32,-m64\}
dg.exp=overload15.C'
reproduces the problem and is something people should do to catch issues like
this.

Reply via email to