OSDN Git Service

2003-06-30 Giovanni Bajo <giovannibajo@libero.it>
authorbangerth <bangerth@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 30 Jun 2003 19:21:25 +0000 (19:21 +0000)
committerbangerth <bangerth@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 30 Jun 2003 19:21:25 +0000 (19:21 +0000)
        PR c++/4933
        * g++.dg/template/sizeof4.C: New test.

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

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

index ae6c417..b8cd1c5 100644 (file)
@@ -1,5 +1,10 @@
 2003-06-30  Giovanni Bajo  <giovannibajo@libero.it>
 
+        PR c++/4933
+        * g++.dg/template/sizeof4.C: New test.
+
+2003-06-30  Giovanni Bajo  <giovannibajo@libero.it>
+
         * g++.dg/other/error6.C: New test.
 
 2003-06-30  Giovanni Bajo  <giovannibajo@libero.it>
diff --git a/gcc/testsuite/g++.dg/template/sizeof4.C b/gcc/testsuite/g++.dg/template/sizeof4.C
new file mode 100644 (file)
index 0000000..4856a27
--- /dev/null
@@ -0,0 +1,18 @@
+// { dg-do compile }
+// Origin: <anthwil at nortelnetworks dot com>
+// c++/4933: using sizeof with comma operator as template argument
+
+template<unsigned F>
+struct Foo {};
+
+template<typename T>
+T makeT();
+
+template<typename T,typename U>
+struct Bar
+{
+  typedef Foo
+  <
+    sizeof((makeT<T>(), makeT<U>()))
+  > Type;
+};