Patchwork [C++,testcases,added] PR 25503 & PR 26572

login
register
mail settings
Submitter Paolo Carlini
Date May 24, 2013, 10:07 a.m.
Message ID <519F3BCE.5060403@oracle.com>
Download mbox | patch
Permalink /patch/246122/
State New
Headers show

Comments

Paolo Carlini - May 24, 2013, 10:07 a.m.
Hi,

both issues already fixed. Committed to mainline.

Thanks,
Paolo.

/////////////////////
2013-05-24  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/26572
	* g++.dg/template/error51.C: New.

2013-05-24  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/25503
	* g++.dg/template/bitfield2.C: New.

Index: g++.dg/template/error51.C
===================================================================
--- g++.dg/template/error51.C	(revision 0)
+++ g++.dg/template/error51.C	(working copy)
@@ -0,0 +1,9 @@
+// PR c++/26572
+
+template<int> void foo()
+{
+  struct A;                // { dg-error "declaration" }
+  struct B : A {};         // { dg-error "invalid use of incomplete" }
+}
+
+template void foo<0>();

Patch

Index: g++.dg/template/bitfield2.C
===================================================================
--- g++.dg/template/bitfield2.C	(revision 0)
+++ g++.dg/template/bitfield2.C	(working copy)
@@ -0,0 +1,16 @@ 
+// PR c++/25503
+
+template<int N>
+struct Test
+{
+  Test()
+  {
+    typedef struct StaticAssert {unsigned condition : (N); } XXX; // { dg-error "zero width" }
+  }
+};
+
+int
+main()
+{
+  Test<0> T;
+}