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
This commit is contained in:
parent
2816d1644f
commit
b3da7bb1cf
@ -1,3 +1,8 @@
|
||||
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.
|
||||
|
@ -5778,6 +5778,8 @@ tsubst_decl (t, args, type, in_decl)
|
||||
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
|
||||
|
15
gcc/testsuite/g++.old-deja/g++.pt/error2.C
Normal file
15
gcc/testsuite/g++.old-deja/g++.pt/error2.C
Normal file
@ -0,0 +1,15 @@
|
||||
// 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:
|
||||
t=_t;
|
||||
}
|
||||
|
||||
anotherT getT() {
|
||||
anotherT getT() { // ERROR - undefined type
|
||||
return t;
|
||||
}
|
||||
};
|
||||
@ -20,8 +20,8 @@ class B : public A< B > // ERROR - forward declaration
|
||||
{
|
||||
public:
|
||||
typedef int myT;
|
||||
};
|
||||
}; // ERROR - base with non-default constructor
|
||||
|
||||
int main() {
|
||||
B b;
|
||||
B b; // ERROR - no constructor
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user