/cp
authorpaolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 19 Jun 2013 08:49:59 +0000 (08:49 +0000)
committerpaolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 19 Jun 2013 08:49:59 +0000 (08:49 +0000)
2013-06-19  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>

PR c++/57638
* pt.c (unify, [TEMPLATE_PARM_INDEX]): Pass to unify_type_mismatch
TREE_TYPE (arg), not arg itself.

/testsuite
2013-06-19  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>

PR c++/57638
* g++.dg/template/error53.C: New.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@200192 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/cp/ChangeLog
gcc/cp/pt.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/template/error53.C [new file with mode: 0644]

index 7e25e52..cc3fdde 100644 (file)
@@ -1,3 +1,9 @@
+2013-06-19  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
+
+       PR c++/57638
+       * pt.c (unify, [TEMPLATE_PARM_INDEX]): Pass to unify_type_mismatch
+       TREE_TYPE (arg), not arg itself.
+
 2013-06-18  Paolo Carlini  <paolo.carlini@oracle.com>
 
        PR c++/53211
index 25cbf31..517f05b 100644 (file)
@@ -16961,7 +16961,7 @@ unify (tree tparms, tree targs, tree parm, tree arg, int strict,
           later.  */
        return unify_success (explain_p);
       else
-       return unify_type_mismatch (explain_p, tparm, arg);
+       return unify_type_mismatch (explain_p, tparm, TREE_TYPE (arg));
 
       /* If ARG is a parameter pack or an expansion, we cannot unify
         against it unless PARM is also a parameter pack.  */
index 73e1c62..1d7c2af 100644 (file)
@@ -1,3 +1,8 @@
+2013-06-19  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
+
+       PR c++/57638
+       * g++.dg/template/error53.C: New.
+
 2013-06-19  Sebastian Huber  <sebastian.huber@embedded-brains.de>
 
        PR target/55033
diff --git a/gcc/testsuite/g++.dg/template/error53.C b/gcc/testsuite/g++.dg/template/error53.C
new file mode 100644 (file)
index 0000000..5976c86
--- /dev/null
@@ -0,0 +1,13 @@
+// PR c++/57638
+
+template<int x>
+struct S {};
+
+template<long long i>
+void g(S<i>);
+
+void f()
+{
+  S<1000> t;
+  g(t);         // { dg-error "no matching" }
+}  // { dg-message "mismatched types 'long long int' and 'int'" "" { target *-*-* } 12 }