]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR c++/53763 (Missing error check on decltype when used within variadic template...
authorPaolo Carlini <paolo.carlini@oracle.com>
Tue, 9 Oct 2012 16:09:32 +0000 (16:09 +0000)
committerPaolo Carlini <paolo@gcc.gnu.org>
Tue, 9 Oct 2012 16:09:32 +0000 (16:09 +0000)
2012-10-09  Paolo Carlini  <paolo.carlini@oracle.com>

PR c++/53763
* g++.dg/cpp0x/decltype43.C: New.

From-SVN: r192263

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

index eb346476cc7e8fb9bd9b4e3e173bd81f7befc74a..245174ee2d6e3607f72b71da98243c51f675efe3 100644 (file)
@@ -1,3 +1,8 @@
+2012-10-09  Paolo Carlini  <paolo.carlini@oracle.com>
+
+       PR c++/53763
+       * g++.dg/cpp0x/decltype43.C: New.
+
 2012-10-09  Paolo Carlini  <paolo.carlini@oracle.com>
 
        PR c++/54194
diff --git a/gcc/testsuite/g++.dg/cpp0x/decltype43.C b/gcc/testsuite/g++.dg/cpp0x/decltype43.C
new file mode 100644 (file)
index 0000000..4df95a1
--- /dev/null
@@ -0,0 +1,27 @@
+// PR c++/53763
+// { dg-do compile { target c++11 } }
+
+template<typename TYPE>
+struct A
+{
+  static int a(TYPE value)
+  {
+    return value;
+  }
+};
+
+template<typename... ARGS>
+struct B
+{
+  static int b(ARGS...)
+  {
+    return 0;
+  }
+};
+
+int main()
+{
+  int x = B<decltype(A<int>::a(1))>::b(A<int>::a(1));
+  int y = B<decltype(A     ::a(2))>::b(A<int>::a(2)); // { dg-error "template argument" }
+  return x + y;
+}