mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-03-25 16:50:49 +08:00
re PR c++/18586 (ICE on invalid template member declaration)
PR c++/18586 * parser.c (cp_parser_init_declarator): Do not pop scope twice. PR c++/18586 * g++.dg/template/crash27.C: New test. From-SVN: r91182
This commit is contained in:
parent
fc57e2c7ef
commit
62a4d9428b
@ -1,5 +1,8 @@
|
||||
2004-11-24 Mark Mitchell <mark@codesourcery.com>
|
||||
|
||||
PR c++/18586
|
||||
* parser.c (cp_parser_init_declarator): Do not pop scope twice.
|
||||
|
||||
PR c++/18530
|
||||
* cp-tree.h (CTOR_NAME): Remove.
|
||||
(DTOR_NAME): Remove.
|
||||
|
@ -10590,7 +10590,10 @@ cp_parser_init_declarator (cp_parser* parser,
|
||||
if (member_p)
|
||||
{
|
||||
if (pop_p)
|
||||
pop_scope (scope);
|
||||
{
|
||||
pop_scope (scope);
|
||||
pop_p = false;
|
||||
}
|
||||
decl = grokfield (declarator, decl_specifiers,
|
||||
initializer, /*asmspec=*/NULL_TREE,
|
||||
/*attributes=*/NULL_TREE);
|
||||
|
@ -1,5 +1,8 @@
|
||||
2004-11-24 Mark Mitchell <mark@codesourcery.com>
|
||||
|
||||
PR c++/18586
|
||||
* g++.dg/template/crash27.C: New test.
|
||||
|
||||
PR c++/18530
|
||||
* g++.dg/warn/Wshadow-3.C: New test.
|
||||
|
||||
|
9
gcc/testsuite/g++.dg/template/deduce3.C
Normal file
9
gcc/testsuite/g++.dg/template/deduce3.C
Normal file
@ -0,0 +1,9 @@
|
||||
template <typename T>
|
||||
void f(int, T (*)() = 0);
|
||||
|
||||
void g() {
|
||||
typedef int A[2];
|
||||
f<A>(0); // { dg-error "" }
|
||||
typedef void F();
|
||||
f<F>(0); // { dg-error "" }
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user