re PR c++/17413 (local classes as template argument)
PR c++/17413 * pt.c (check_instantiated_args): Remove bogus SFINAE code. PR c++/17413 * g++.dg/template/local4.C: New test. * g++.dg/template/crash19.C: Add dg-error marker. From-SVN: r92562
This commit is contained in:
parent
3316f96899
commit
aae4a27747
@ -1,5 +1,8 @@
|
||||
2004-12-23 Mark Mitchell <mark@codesourcery.com>
|
||||
|
||||
PR c++/17413
|
||||
* pt.c (check_instantiated_args): Remove bogus SFINAE code.
|
||||
|
||||
* cvt.c (convert_to_void): Fix typo in comment.
|
||||
|
||||
2004-12-23 Alexandre Oliva <aoliva@redhat.com>
|
||||
|
@ -8926,9 +8926,7 @@ check_instantiated_args (tree tmpl, tree args, tsubst_flags_t complain)
|
||||
|
||||
if (nt)
|
||||
{
|
||||
if (!(complain & tf_error))
|
||||
/*OK*/;
|
||||
else if (TYPE_ANONYMOUS_P (nt))
|
||||
if (TYPE_ANONYMOUS_P (nt))
|
||||
error ("%qT uses anonymous type", t);
|
||||
else
|
||||
error ("%qT uses local type %qT", t, nt);
|
||||
|
@ -1,5 +1,9 @@
|
||||
2004-12-23 Mark Mitchell <mark@codesourcery.com>
|
||||
|
||||
PR c++/17413
|
||||
* g++.dg/template/local4.C: New test.
|
||||
* g++.dg/template/crash19.C: Add dg-error marker.
|
||||
|
||||
* g++.dg/template/crash31.C: Correct embedded PR number.
|
||||
|
||||
2004-12-23 Mark Mitchell <mark@codesourcery.com>
|
||||
|
@ -9,7 +9,7 @@ template <class T>
|
||||
struct X {
|
||||
enum { SIXTY_FOUR=64 };
|
||||
struct node {
|
||||
unsigned char *ptr[sizeof(T)*SIXTY_FOUR];
|
||||
unsigned char *ptr[sizeof(T)*SIXTY_FOUR]; // { dg-error "" }
|
||||
void d() {}
|
||||
};
|
||||
node *head;
|
||||
|
11
gcc/testsuite/g++.dg/template/local4.C
Normal file
11
gcc/testsuite/g++.dg/template/local4.C
Normal file
@ -0,0 +1,11 @@
|
||||
// PR c++/17413
|
||||
|
||||
template <typename T> void foo() {}
|
||||
|
||||
int main () {
|
||||
struct S {};
|
||||
// We do not simply use "local|match" on line 10 because we want to
|
||||
// make sure that "local" appears.
|
||||
// { dg-error "local" "" { target *-*-* } 10 }
|
||||
foo<S> (); // { dg-error "match" }
|
||||
}
|
Loading…
Reference in New Issue
Block a user