summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/cpp0x/pr45908.C
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/g++.dg/cpp0x/pr45908.C')
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/pr45908.C18
1 files changed, 18 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/cpp0x/pr45908.C b/gcc/testsuite/g++.dg/cpp0x/pr45908.C
new file mode 100644
index 000000000..3a8508890
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/pr45908.C
@@ -0,0 +1,18 @@
+// PR c++/45908
+// Testcase by Jonathan Wakely <redi@gcc.gnu.org>
+
+// { dg-do compile }
+// { dg-options "-std=c++0x" }
+
+struct vector {
+ struct iterator { };
+ struct const_iterator { };
+ iterator begin();
+ const_iterator begin() const;
+};
+
+class block {
+ vector v;
+ auto end() const -> decltype(v.begin())
+ { return v.begin(); } // { dg-error "could not convert" }
+};