Commit e23afa25 by Mark Mitchell Committed by Mark Mitchell

decl.c (grokdeclarator): Don't complain about in-class initialization of static consts if...

	* 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
parent 2879ca2a
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.
......
......@@ -10003,7 +10003,8 @@ grokdeclarator (declarator, declspecs, decl_context, initialized, attrlist)
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);
}
......
// Build don't link:
template <class T>
struct S
{
static const T t = 3;
};
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment