public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [C++, committed] Add c++/48735 testcase
@ 2011-05-10  6:46 Paolo Carlini
  0 siblings, 0 replies; only message in thread
From: Paolo Carlini @ 2011-05-10  6:46 UTC (permalink / raw)
  To: gcc-patches

[-- Attachment #1: Type: text/plain, Size: 244 bytes --]

Hi,

I committed the testcase provided by Daniel in c++/48735 and closed the 
PR as already fixed. Also took the occasion to move my recent c++0x 
testcases to the proper cpp0x directory.

Tested x86_64-linux.

Paolo.

////////////////////////

[-- Attachment #2: CL_48735 --]
[-- Type: text/plain, Size: 322 bytes --]

2011-05-09  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/48735
	* g++.dg/cpp0x/sfinae21.C: New.

2011-05-09  Paolo Carlini  <paolo.carlini@oracle.com>

	* g++.dg/template/sfinae28.C: Rename to...
	* g++.dg/cpp0x/sfinae19.C: ... this.
	* g++.dg/template/sfinae29.C: Rename to...
	* g++.dg/cpp0x/sfinae20.C: ... this.

[-- Attachment #3: patch_48735 --]
[-- Type: text/plain, Size: 1574 bytes --]

Index: g++.dg/cpp0x/sfinae21.C
===================================================================
--- g++.dg/cpp0x/sfinae21.C	(revision 0)
+++ g++.dg/cpp0x/sfinae21.C	(revision 0)
@@ -0,0 +1,14 @@
+// PR c++/48735
+// { dg-options "-std=c++0x" }
+
+template<class T, 
+ class = decltype(T{})
+>
+char f(int);
+
+template<class>
+char (&f(...))[2];
+
+struct ND { ND() = delete; };
+
+static_assert(sizeof(f<ND[1]>(0)) != 1, "Error");
Index: g++.dg/template/sfinae28.C
===================================================================
--- g++.dg/template/sfinae28.C	(revision 173596)
+++ g++.dg/template/sfinae28.C	(working copy)
@@ -1,13 +0,0 @@
-// PR c++/48737
-// { dg-options "-std=c++0x" }
-
-template<class T>
-T&& create();
-
-template<class T, class... Args>
-decltype(T{create<Args>()...}, char()) f(int);
-
-template<class, class...>
-char (&f(...))[2];
-
-static_assert(sizeof(f<int[1], int, int>(0)) != 1, "Error");
Index: g++.dg/template/sfinae29.C
===================================================================
--- g++.dg/template/sfinae29.C	(revision 173596)
+++ g++.dg/template/sfinae29.C	(working copy)
@@ -1,23 +0,0 @@
-// PR c++/48744
-// { dg-options "-std=c++0x" }
-
-template<class T>
-struct add_rval_ref {
-  typedef T&& type;
-};
-
-template<>
-struct add_rval_ref<void> {
-  typedef void type;
-};
-
-template<class T>
-typename add_rval_ref<T>::type create();
-
-template<class T, class Arg>
-decltype(T{create<Arg>()}, char()) f(int);
-
-template<class, class>
-char (&f(...))[2];
-
-static_assert(sizeof(f<int, void>(0)) != 1, "Error");

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2011-05-09 23:00 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-05-10  6:46 [C++, committed] Add c++/48735 testcase Paolo Carlini

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).