+2005-06-13 Nathan Sidwell <nathan@codesourcery.com>
+
+ PR c++/20789
+ * decl.c (cp_finish_decl): Clear runtime runtime initialization if
+ in-class decl's initializer is bad.
+
2005-06-10 Aldy Hernandez <aldyh@redhat.com>
PR c++/10611
"initialized", decl);
init = NULL_TREE;
}
+ if (DECL_EXTERNAL (decl) && init)
+ {
+ /* The static data member cannot be initialized by a
+ non-constant when being declared. */
+ error ("`%D' cannot be initialized by a non-constant expression"
+ " when being declared", decl);
+ DECL_INITIALIZED_IN_CLASS_P (decl) = 0;
+ init = NULL_TREE;
+ }
+
/* Handle:
[dcl.init]
+2005-06-13 Nathan Sidwell <nathan@codesourcery.com>
+
+ PR c++/20789
+ * g++.dg/init/member1.C: New.
+ * g++.dg/other/warning1.C: Adjust.
+
2005-06-08 Nathan Sidwell <nathan@codesourcery.com>
PR c++/21903
{
static const int i = A<T>::i; // { dg-error "incomplete" }
static const int j = i; // { dg-error "initialized by a non-const" }
- B<j> b; // { dg-error "not a valid template arg" }
+ B<j> b; // { dg-error "cannot be used as template arg" }
};
C<int> c;
struct S
{
- static const float inf = 1.0f / 0.0f; // { dg-warning "1.0|initialization" }
- static const float nan = 0.0f / 0.0f; // { dg-warning "0.0|initialization" }
+ static const float inf = 1.0f / 0.0f; // { dg-warning "1.0|initializ" }
+ static const float nan = 0.0f / 0.0f; // { dg-warning "0.0|initializ" }
};
int main()