* gcc/tree.c (ctor_to_list): Use FOR_EACH_CONSTRUCTOR_ELT.
* gcc/cp/Make-lang.in (cp/typeck2.o): Add dependency.
* libstdc++-v3/libsupc++/initializer_list: Uglify and wrap in
__GXX_EXPERIMENTAL_CXX0X__.
* libstdc++-v3/include/bits/stl_map.h (insert(initializer_list)): Wrap.
From-SVN: r137406
2008-07-02 Jason Merrill <jason@redhat.com>
+ * tree.c (ctor_to_list): Use FOR_EACH_CONSTRUCTOR_ELT.
+
* tree.c (ctor_to_list): New fn.
* tree.h: Declare it.
(CONSTRUCTOR_ELT): New macro.
2008-07-02 Jason Merrill <jason@redhat.com>
+ * Make-lang.in (cp/typeck2.o): Add $(REAL_H) dependency.
+
Implement WG21 N2672, Initializer List proposed wording
* cp-tree.h (enum cp_tree_index): Add CPTI_INIT_LIST_TYPE.
(struct lang_type_class): Add has_list_ctor bitfield.
langhooks.h $(LANGHOOKS_DEF_H) $(DIAGNOSTIC_H) debug.h \
$(CXX_PRETTY_PRINT_H) cp/cp-objcp-common.h gt-cp-cp-objcp-common.h
cp/typeck2.o: cp/typeck2.c $(CXX_TREE_H) $(TM_H) $(FLAGS_H) toplev.h output.h \
- $(TM_P_H) $(DIAGNOSTIC_H) gt-cp-typeck2.h
+ $(TM_P_H) $(DIAGNOSTIC_H) gt-cp-typeck2.h $(REAL_H)
cp/typeck.o: cp/typeck.c $(CXX_TREE_H) $(TM_H) $(FLAGS_H) $(RTL_H) $(EXPR_H) \
toplev.h $(DIAGNOSTIC_H) convert.h $(C_COMMON_H) $(TARGET_H)
cp/class.o: cp/class.c $(CXX_TREE_H) $(TM_H) $(FLAGS_H) toplev.h $(RTL_H) \
tree list = NULL_TREE;
tree *p = &list;
unsigned ix;
- constructor_elt *ce;
+ tree purpose, val;
- for (ix = 0;
- VEC_iterate (constructor_elt, CONSTRUCTOR_ELTS (ctor), ix, ce);
- ++ix)
+ FOR_EACH_CONSTRUCTOR_ELT (CONSTRUCTOR_ELTS (ctor), ix, purpose, val)
{
- *p = build_tree_list (ce->index, ce->value);
+ *p = build_tree_list (purpose, val);
p = &TREE_CHAIN (*p);
}
+2008-07-02 Jason Merrill <jason@redhat.com>
+
+ * libsupc++/initializer_list: Uglify and wrap in
+ __GXX_EXPERIMENTAL_CXX0X__.
+ * include/bits/stl_map.h (insert(initializer_list)): Wrap.
+
2008-07-02 Jason Merrill <jason@redhat.com>
* libsupc++/initializer_list: New file.
insert(const value_type& __x)
{ return _M_t._M_insert_unique(__x); }
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
/**
* @brief Attempts to insert a list of std::pairs into the %map.
* @param list A std::initializer_list<value_type> of pairs to be
*
*/
void
- insert(std::initializer_list<value_type> list)
- { insert (list.begin(), list.end()); }
+ insert(std::initializer_list<value_type> __list)
+ { insert (__list.begin(), __list.end()); }
+#endif
/**
* @brief Attempts to insert a std::pair into the %map.
#ifndef __CXX_INITIALIZER_LIST
#define __CXX_INITIALIZER_LIST
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+
#pragma GCC visibility push(default)
#include <cstddef>
namespace std
{
- template<class E>
+ template<class _E>
class initializer_list
{
- const E* _array;
- size_t _len;
+ const _E* __array;
+ size_t __len;
// The compiler can call a private constructor.
- initializer_list(const E* _a, size_t _l)
- : _array(_a), _len(_l) { }
+ initializer_list(const _E* __a, size_t __l)
+ : __array(__a), __len(__l) { }
public:
initializer_list()
- : _array(NULL), _len(0) {}
+ : __array(NULL), __len(0) {}
size_t size() const // number of elements
- { return _len; }
- const E* begin() const // first element
- { return _array; }
- const E* end() const // one past the last element
+ { return __len; }
+ const _E* begin() const // first element
+ { return __array; }
+ const _E* end() const // one past the last element
{ return begin() + size(); }
};
}
#pragma GCC visibility pop
+#endif // C++0x
#endif // __CXX_INITIALIZER_LIST