PR c++/48994
* parser.c (cp_parser_perform_range_for_lookup): Call complete_type.
From-SVN: r173778
+2011-05-15 Jonathan Wakely <jwakely.gcc@gmail.com>
+
+ PR c++/48994
+ * parser.c (cp_parser_perform_range_for_lookup): Call complete_type.
+
2011-05-13 Ville Voutilainen <ville.voutilainen@gmail.com>
Implement final on class.
static tree
cp_parser_perform_range_for_lookup (tree range, tree *begin, tree *end)
{
- if (!COMPLETE_TYPE_P (TREE_TYPE (range)))
+ if (!COMPLETE_TYPE_P (complete_type (TREE_TYPE (range))))
{
error ("range-based %<for%> expression of type %qT "
"has incomplete type", TREE_TYPE (range));
+2011-05-15 Jonathan Wakely <jwakely.gcc@gmail.com>
+
+ PR c++/48994
+ * g++.dg/cpp0x/range-for18.C: New.
+
2011-05-15 Tobias Burnus <burnus@net-b.de>
PR fortran/18918
--- /dev/null
+// PR c++/48994
+
+// { dg-do compile }
+// { dg-options "-std=c++0x" }
+
+template <typename T>
+struct myvec
+{
+ T* begin() const;
+ T* end() const;
+};
+
+void f(const myvec<int>& v)
+{
+ for (int i : v)
+ ;
+}