Commit b3da7bb1 by Mark Mitchell Committed by Mark Mitchell

pt.c (tsubst_decl): If the type of a template instantiation is bogus, so is the…

pt.c (tsubst_decl): If the type of a template instantiation is bogus, so is the whole instantiation.

	* pt.c (tsubst_decl): If the type of a template instantiation is
	bogus, so is the whole instantiation.

From-SVN: r29757
parent 2816d164
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> 1999-09-30 Mark Mitchell <mark@codesourcery.com>
* decl.c (initialize_local_var): Handle static variables here. * decl.c (initialize_local_var): Handle static variables here.
......
...@@ -5778,6 +5778,8 @@ tsubst_decl (t, args, type, in_decl) ...@@ -5778,6 +5778,8 @@ tsubst_decl (t, args, type, in_decl)
ctx = NULL_TREE; ctx = NULL_TREE;
} }
type = tsubst (type, args, /*complain=*/1, in_decl); 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 /* We do NOT check for matching decls pushed separately at this
point, as they may not represent instantiations of this point, as they may not represent instantiations of this
......
// 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
}
...@@ -11,7 +11,7 @@ public: ...@@ -11,7 +11,7 @@ public:
t=_t; t=_t;
} }
anotherT getT() { anotherT getT() { // ERROR - undefined type
return t; return t;
} }
}; };
...@@ -20,8 +20,8 @@ class B : public A< B > // ERROR - forward declaration ...@@ -20,8 +20,8 @@ class B : public A< B > // ERROR - forward declaration
{ {
public: public:
typedef int myT; typedef int myT;
}; }; // ERROR - base with non-default constructor
int main() { int main() {
B b; B b; // ERROR - no constructor
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment