summaryrefslogtreecommitdiff
path: root/gcc/testsuite
diff options
context:
space:
mode:
authorjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>2009-07-14 18:15:35 +0000
committerjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>2009-07-14 18:15:35 +0000
commitd69c0c735bc3e67f49f7283c3b75d8834e44116a (patch)
treef913131dcfc39f5179b8168f8020117cb96dc13e /gcc/testsuite
parent7abca321b6cf84e08125e8ebc2f56b4b6292d133 (diff)
downloadgcc-d69c0c735bc3e67f49f7283c3b75d8834e44116a.tar.gz
PR c++/40740
* semantics.c (perform_koenig_lookup): Handle empty template args. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@149636 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite')
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/g++.dg/template/koenig8.C20
2 files changed, 25 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index ec32f9e31aa..58ce71cf8a0 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2009-07-14 Jason Merrill <jason@redhat.com>
+
+ PR c++/40740
+ * g++.dg/template/koenig8.C: New.
+
2009-07-14 Jack Howarth <howarth@bromo.med.uc.edu>
* testsuite/gcc.c-torture/compile/20000804-1.c: skip for ilp32 on
diff --git a/gcc/testsuite/g++.dg/template/koenig8.C b/gcc/testsuite/g++.dg/template/koenig8.C
new file mode 100644
index 00000000000..5a49a7066da
--- /dev/null
+++ b/gcc/testsuite/g++.dg/template/koenig8.C
@@ -0,0 +1,20 @@
+// PR c++/40740
+
+template<class T>
+T addsome(T v) {
+ return v+1;
+}
+
+int addsome(int v) {
+ return v+2;
+}
+
+int main() {
+ int i = 0;
+ if (addsome(i) != 2)
+ return 1;
+ if (addsome<>(i) != 1)
+ return 2;
+ return 0;
+}
+