* decl.c (grokdeclarator): Don't complain about in-class
initialization of static consts if we don't really know the type
of the variable.
From-SVN: r20139
+1998-05-29 Mark Mitchell <mark@markmitchell.com>
+
+ * decl.c (grokdeclarator): Don't complain about in-class
+ initialization of static consts if we don't really know the type
+ of the variable.
+
1998-05-29 Jason Merrill <jason@yorick.cygnus.com>
* cp-tree.h (DECL_DESTRUCTOR_P): New macro.
cp_error ("ANSI C++ forbids in-class initialization of non-const static member `%D'",
declarator);
- if (pedantic && ! INTEGRAL_TYPE_P (type))
+ if (pedantic && ! INTEGRAL_TYPE_P (type)
+ && !uses_template_parms (type))
cp_pedwarn ("ANSI C++ forbids initialization of member constant `%D' of non-integral type `%T'", declarator, type);
}
--- /dev/null
+// Build don't link:
+
+template <class T>
+struct S
+{
+ static const T t = 3;
+};
+