]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
PR c++/65707
authormpolacek <mpolacek@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 22 Jun 2019 16:29:06 +0000 (16:29 +0000)
committermpolacek <mpolacek@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 22 Jun 2019 16:29:06 +0000 (16:29 +0000)
PR c++/89480
PR c++/58836
* g++.dg/cpp0x/nondeduced5.C: New test.
* g++.dg/cpp0x/nondeduced6.C: New test.
* g++.dg/cpp0x/nondeduced7.C: New test.

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

gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/cpp0x/nondeduced5.C [new file with mode: 0644]
gcc/testsuite/g++.dg/cpp0x/nondeduced6.C [new file with mode: 0644]
gcc/testsuite/g++.dg/cpp0x/nondeduced7.C [new file with mode: 0644]

index d1226e6c3701e459a2b1220e0a6842f516512bd9..02a64ca7fab62bc7125137166162340528b5eb50 100644 (file)
@@ -1,5 +1,12 @@
 2019-06-22  Marek Polacek  <polacek@redhat.com>
 
+       PR c++/65707
+       PR c++/89480
+       PR c++/58836
+       * g++.dg/cpp0x/nondeduced5.C: New test.
+       * g++.dg/cpp0x/nondeduced6.C: New test.
+       * g++.dg/cpp0x/nondeduced7.C: New test.
+
        PR c++/66256
        * g++.dg/cpp0x/noexcept54.C: New test.
 
diff --git a/gcc/testsuite/g++.dg/cpp0x/nondeduced5.C b/gcc/testsuite/g++.dg/cpp0x/nondeduced5.C
new file mode 100644 (file)
index 0000000..dd890ec
--- /dev/null
@@ -0,0 +1,12 @@
+// PR c++/65707
+// { dg-do compile { target c++11 } }
+
+template <int a> struct b {
+  typedef int c;
+  constexpr operator c() { return a; }
+};
+template <bool> struct d;
+template <typename> struct e : b<true> {};
+template <typename, typename = d<true>> struct f;
+template <typename g> struct f<g, d<e<g>{}>> {};
+template struct f<int>;
diff --git a/gcc/testsuite/g++.dg/cpp0x/nondeduced6.C b/gcc/testsuite/g++.dg/cpp0x/nondeduced6.C
new file mode 100644 (file)
index 0000000..9f68e30
--- /dev/null
@@ -0,0 +1,24 @@
+// PR c++/89480
+// { dg-do compile { target c++11 } }
+
+template <typename Foo, Foo Part>
+struct TSelect {};
+
+enum What {
+    The
+};
+
+template <typename Foo>
+struct AnotherOneSelector {
+    static constexpr Foo Id = Foo::The;
+};
+
+template <typename Foo, typename SelectPartType>
+struct THelper;
+
+template <typename Foo>
+struct THelper<Foo, TSelect<Foo, Foo{AnotherOneSelector<Foo>::Id}>> {};
+
+int main() {
+    THelper<What, TSelect<What, What::The>> t;
+}
diff --git a/gcc/testsuite/g++.dg/cpp0x/nondeduced7.C b/gcc/testsuite/g++.dg/cpp0x/nondeduced7.C
new file mode 100644 (file)
index 0000000..a8aa073
--- /dev/null
@@ -0,0 +1,6 @@
+// PR c++/58836
+// { dg-do compile { target c++11 } }
+
+template<typename, int> struct A;
+template<typename T> struct A<T, T{}> {}; // { dg-error "partial specialization" }
+A<int, 0> a;