Thu Mar 26 10:25:52 1998 Mark Mitchell <mmitchell@usa.net>
* pt.c (convert_nontype_argument): STRIP_NOPS where appropriate.
From-SVN: r18841
+Thu Mar 26 10:25:52 1998 Mark Mitchell <mmitchell@usa.net>
+
+ * pt.c (convert_nontype_argument): STRIP_NOPS where appropriate.
+
Thu Mar 26 10:24:05 1998 Mark Mitchell <mmitchell@usa.net>
* call.c (build_object_call): Complain about ambiguous operator(),
|| expr_type == unknown_type_node)
{
tree referent;
+ tree e = expr;
+ STRIP_NOPS (e);
- if (TREE_CODE (expr) != ADDR_EXPR)
+ if (TREE_CODE (e) != ADDR_EXPR)
{
bad_argument:
cp_error ("`%E' is not a valid template argument", expr);
return NULL_TREE;
}
- referent = TREE_OPERAND (expr, 0);
+ referent = TREE_OPERAND (e, 0);
STRIP_NOPS (referent);
if (TREE_CODE (referent) == STRING_CST)
--- /dev/null
+// Build don't link:
+
+enum E { e };
+
+template <const E* ep>
+struct S1
+{
+ static char* s;
+};
+
+template <int D>
+struct S2 {};
+
+template <>
+struct S2<1>
+{
+ static E es[1];
+};
+
+struct S3
+{
+ typedef S1<S2<1>::es> S3_Type;
+};
+
+E S2<1>::es[1] = {e};
+
+template <>
+char* S1<S2<1>::es>::s = "abc";