* class.c (check_field_decls): Don't issue error about
local classes containing static data members.
* g++.dg/other/static2.C: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@116490
138bc75d-0d04-0410-961f-
82ee72b054a4
+2006-08-27 Lee Millward <lee.millward@codesourcery.com>
+
+ PR c++/26573
+ * class.c (check_field_decls): Don't issue error about
+ local classes containing static data members.
+
2006-08-26 Joseph S. Myers <joseph@codesourcery.com>
PR c++/24009
}
}
- /* ``A local class cannot have static data members.'' ARM 9.4 */
- if (current_function_decl && TREE_STATIC (x))
- error ("field %q+D in local class cannot be static", x);
-
/* Perform error checking that did not get done in
grokdeclarator. */
if (TREE_CODE (type) == FUNCTION_TYPE)
+2006-08-27 Lee Millward <lee.millward@codesourcery.com>
+
+ PR c++/26573
+ * g++.dg/other/static2.C: New test.
+
2006-08-26 Roger Sayle <roger@eyesopen.com>
* gcc.dg/Wswitch-enum-2.c: New test case.
--- /dev/null
+//PR c++/26573
+
+void foo()
+{
+ struct A { static int i; }; // { dg-error "shall not have" }
+}
+
+template<typename T>
+void bar()
+{
+ struct B { static int j; }; // { dg-error "shall not have" }
+}