* lex.c (retrofit_lang_decl): Treat entities with no linkage as
having C++ linkage for name-mangling purposes.
PR c++/14260
* parser.c (cp_parser_direct_declarator): Recognize constructor
declarators that use a template-id to name the class being
constructed.
PR c++/14337
* pt.c (tsubst_qualified_id): Handle dependent qualifying scopes.
(tsubst_expr): Do not call tsubst_copy, even when
processing_template_decl.
PR c++/14324
* g++.dg/abi/mangle21.C: New test.
PR c++/14260
* g++.dg/parse/constructor2.C: New test.
PR c++/14337
* g++.dg/template/sfinae1.C: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@78720
138bc75d-0d04-0410-961f-
82ee72b054a4
+2004-03-01 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/14324
+ * lex.c (retrofit_lang_decl): Treat entities with no linkage as
+ having C++ linkage for name-mangling purposes.
+
+ PR c++/14260
+ * parser.c (cp_parser_direct_declarator): Recognize constructor
+ declarators that use a template-id to name the class being
+ constructed.
+
+ PR c++/14337
+ * pt.c (tsubst_qualified_id): Handle dependent qualifying scopes.
+ (tsubst_expr): Do not call tsubst_copy, even when
+ processing_template_decl.
+
2004-03-01 Jeff Law <law@redhat.com>
* init.c (build_vec_delete_1): Convert 2nd argument to NE_EXPR to
ld->u.f.u3sel = TREE_CODE (t) == FUNCTION_DECL ? 1 : 0;
DECL_LANG_SPECIFIC (t) = ld;
- if (current_lang_name == lang_name_cplusplus)
+ if (current_lang_name == lang_name_cplusplus
+ || decl_linkage (t) == lk_none)
SET_DECL_LANGUAGE (t, lang_cplusplus);
else if (current_lang_name == lang_name_c)
SET_DECL_LANGUAGE (t, lang_c);
/* See if it names ctor, dtor or conv. */
if (TREE_CODE (unqualified_name) == BIT_NOT_EXPR
|| IDENTIFIER_TYPENAME_P (unqualified_name)
- || constructor_name_p (unqualified_name, class_type))
+ || constructor_name_p (unqualified_name, class_type)
+ || (TREE_CODE (unqualified_name) == TYPE_DECL
+ && same_type_p (TREE_TYPE (unqualified_name),
+ class_type)))
*ctor_dtor_or_conv_p = -1;
}
else
expr = name;
- my_friendly_assert (!dependent_type_p (scope), 20030729);
+ if (dependent_type_p (scope))
+ return build_nt (SCOPE_REF, scope, expr);
if (!BASELINK_P (name) && !DECL_P (expr))
{
if (t == NULL_TREE || t == error_mark_node)
return t;
- if (processing_template_decl)
- return tsubst_copy (t, args, complain, in_decl);
-
if (!STATEMENT_CODE_P (TREE_CODE (t)))
return tsubst_copy_and_build (t, args, complain, in_decl,
/*function_p=*/false);
+2004-03-01 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/14324
+ * g++.dg/abi/mangle21.C: New test.
+
+ PR c++/14260
+ * g++.dg/parse/constructor2.C: New test.
+
+ PR c++/14337
+ * g++.dg/template/sfinae1.C: New test.
+
2004-02-29 Mark Mitchell <mark@codesourcery.com>
PR c++/14267
--- /dev/null
+// PR c++/14324
+// { dg-do assemble }
+
+extern "C" {
+
+void fun1(void)
+{
+ do { static int xyz __attribute__((unused)) = 1; } while (0);
+ do { static int xyz __attribute__((unused)) = 2; } while (0);
+ do { static int xyz __attribute__((unused)) = 3; } while (0);
+}
+
+}
--- /dev/null
+// PR c++/14260
+
+template <class TClass>
+class T
+{
+public:
+ T(short,short f=0) {}
+ T<TClass>(int f) {}
+ T<TClass>(int f=0,const char* b=0) {}
+};
+
--- /dev/null
+// PR c++/14337
+
+template <bool> struct Constraint;
+template <> struct Constraint<true> { typedef int Result; };
+
+template <typename T>
+struct IsInt { static const bool value = false; };
+
+template <>
+struct IsInt<int> { static const bool value = true; };
+
+template <typename T>
+typename Constraint<IsInt<T>::value>::Result foo(T);
+
+template <typename T>
+typename Constraint<!IsInt<T>::value>::Result foo(T);
+
+template <typename>
+void bar() {
+ foo(1);
+}