* parser.c (cp_parser_primary_expression): Recognize the closing
">" of a template-argument-list after a floating-point literal as
the end of a cast expression.
PR c++/23841
* g++.dg/parse/template17.C: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@104208
138bc75d-0d04-0410-961f-
82ee72b054a4
2005-09-12 Mark Mitchell <mark@codesourcery.com>
+ PR c++/23841
+ * parser.c (cp_parser_primary_expression): Recognize the closing
+ ">" of a template-argument-list after a floating-point literal as
+ the end of a cast expression.
+
+2005-09-12 Mark Mitchell <mark@codesourcery.com>
+
PR c++/23789
* cvt.c (perform_qualification_conversions): Don't create
unnecessary NOP_EXPRs.
/* The end of the cast-expression. */
&& next_token->type != CPP_CLOSE_PAREN
/* The end of an array bound. */
- && next_token->type != CPP_CLOSE_SQUARE)
+ && next_token->type != CPP_CLOSE_SQUARE
+ /* The closing ">" in a template-argument-list. */
+ && (next_token->type != CPP_GREATER
+ || parser->greater_than_is_operator_p))
cast_p = false;
}
2005-09-12 Mark Mitchell <mark@codesourcery.com>
+ PR c++/23841
+ * g++.dg/parse/template17.C: New test.
+
+2005-09-12 Mark Mitchell <mark@codesourcery.com>
+
PR c++/23789
* g++.dg/template/nontype14.C: New test.
--- /dev/null
+// PR c++/23841
+
+template <int I>
+struct S
+{
+ int f(int i = I) { return i; }
+};
+
+void
+g ()
+{
+ S<(int)0.> a2;
+}