* pt.c (tsubst_decl): If the type of a template instantiation is
bogus, so is the whole instantiation.
From-SVN: r29757
+1999-10-01 Mark Mitchell <mark@codesourcery.com>
+
+ * pt.c (tsubst_decl): If the type of a template instantiation is
+ bogus, so is the whole instantiation.
+
1999-09-30 Mark Mitchell <mark@codesourcery.com>
* decl.c (initialize_local_var): Handle static variables here.
ctx = NULL_TREE;
}
type = tsubst (type, args, /*complain=*/1, in_decl);
+ if (type == error_mark_node)
+ return error_mark_node;
/* We do NOT check for matching decls pushed separately at this
point, as they may not represent instantiations of this
--- /dev/null
+// Build don't link:
+// Origin: Carl Nygard <cnygard@bellatlantic.net>
+
+template <class RT>
+class Test { // ERROR - in instantiation
+public:
+ Test(const RT& c = RT()) {} // ERROR - reference to void
+};
+
+void f ()
+{
+ Test<void> c; // ERROR - instantiated from here
+}
+
+
t=_t;
}
- anotherT getT() {
+ anotherT getT() { // ERROR - undefined type
return t;
}
};
{
public:
typedef int myT;
-};
+}; // ERROR - base with non-default constructor
int main() {
- B b;
+ B b; // ERROR - no constructor
}