+2004-02-03 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/13975
+ * tree.h (enum tree_index): Add TI_PUBLIC, TI_PROTECTED, and
+ TI_PRIVATE.
+ (access_public_node): Redefine.
+ (access_protected_node): Likewise.
+ (access_private_node): Likewise.
+ * tree.c (build_common_tree_nodes): Create access_public_node,
+ access_protected_node, and access_private_node.
+
2004-02-03 Steve Ellcey <sje@cup.hp.com>
* config/ia64/ia64.h (MASK_INLINE_INT_DIV_LAT): Change value.
+2004-02-03 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/13978
+ * pt.c (build_non_dependent_expr): Do not build
+ NON_DEPENDENT_EXPRs for FUNCTION_DECLs or TEMPLATE_DECLs.
+
+ PR c++/13968
+ * semantics.c (finish_id_expression): Do not return an
+ IDENTIFIER_NODE when lookup finds a VAR_DECL.
+
+ PR c++/13975
+ * parser.c (cp_parser_simple_declaration): When skipping to the
+ end of the statement swallow the terminating semicolon.
+
2004-02-02 Mark Mitchell <mark@codesourcery.com>
PR c++/13113
cp_parser_error (parser, "expected `,' or `;'");
/* Skip tokens until we reach the end of the statement. */
cp_parser_skip_to_end_of_statement (parser);
+ /* If the next token is now a `;', consume it. */
+ if (cp_lexer_next_token_is (parser->lexer, CPP_SEMICOLON))
+ cp_lexer_consume_token (parser->lexer);
goto done;
}
/* After the first time around, a function-definition is not
return expr;
/* Preserve OVERLOADs; the functions must be available to resolve
types. */
- if (TREE_CODE (expr) == OVERLOAD)
+ if (TREE_CODE (expr) == OVERLOAD
+ || TREE_CODE (expr) == FUNCTION_DECL
+ || TREE_CODE (expr) == TEMPLATE_DECL)
return expr;
/* Preserve string constants; conversions from string constants to
"char *" are allowed, even though normally a "const char *"
if (integral_constant_expression_p)
*non_integral_constant_expression_p = true;
*idk = CP_ID_KIND_UNQUALIFIED_DEPENDENT;
+ /* If we found a variable, then name lookup during the
+ instantiation will always resolve to the same VAR_DECL
+ (or an instantiation thereof). */
+ if (TREE_CODE (decl) == VAR_DECL)
+ return decl;
return id_expression;
}
+2004-02-03 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/13978
+ * g++.dg/template/koenig4.C: New test.
+
+ PR c++/13968
+ * g++.dg/template/crash17.C: New test.
+
+ PR c++/13975
+ * g++.dg/parse/error13.C: New test.
+ * g++.old-deja/g++.robertl/eb125.C: Tweak error messages.
+
2004-02-03 Eric Botcazou <ebotcazou@libertysurf.fr>
* gcc.dg/20020503-1.c: Remove -mflat dg-options.
--- /dev/null
+template <int I>
+struct A {
+};
+
+template <typename T>
+struct B {
+ typedef typename T::type type;
+ static const type j = T::j;
+
+ A<j> b;
+};
+
+struct C {
+ typedef int type;
+ static const int j = 3;
+};
+
+int i = B<C>::j;
+
--- /dev/null
+// PR c++/13978
+
+namespace ns {
+ template <class TP> void func1(TP* t);
+ struct A {};
+}
+
+template < class TP >
+void func2() {
+ func1( new ns::A() );
+}
+
template <class BOX> void test(BOX *the_box) // { dg-error "" } semicolon missing
{x
the_box->print();
- }; // { dg-error "" }
+ };
template void test<> (test_box *); // { dg-error "" }
unsigned_intSI_type_node = make_unsigned_type (GET_MODE_BITSIZE (SImode));
unsigned_intDI_type_node = make_unsigned_type (GET_MODE_BITSIZE (DImode));
unsigned_intTI_type_node = make_unsigned_type (GET_MODE_BITSIZE (TImode));
+
+ access_public_node = get_identifier ("public");
+ access_protected_node = get_identifier ("protected");
+ access_private_node = get_identifier ("private");
}
/* Call this function after calling build_common_tree_nodes and set_sizetype.
TI_BITSIZE_ONE,
TI_BITSIZE_UNIT,
+ TI_PUBLIC,
+ TI_PROTECTED,
+ TI_PRIVATE,
+
TI_BOOLEAN_FALSE,
TI_BOOLEAN_TRUE,
#define bitsize_unit_node global_trees[TI_BITSIZE_UNIT]
/* Base access nodes. */
-#define access_public_node NULL_TREE
-#define access_protected_node size_zero_node
-#define access_private_node size_one_node
+#define access_public_node global_trees[TI_PUBLIC]
+#define access_protected_node global_trees[TI_PROTECTED]
+#define access_private_node global_trees[TI_PRIVATE]
#define null_pointer_node global_trees[TI_NULL_POINTER]