re PR c++/29077 (Incorrect error message for destructor in wrong namespace)
2007-03-28 Simon Martin <simartin@users.sourceforge.net> PR c++/29077 * decl.c (grokfndecl): Properly setup decl if it is a constructor or a destructor. From-SVN: r123312
This commit is contained in:
parent
8975ae2285
commit
71aea5f2e0
|
@ -1,3 +1,9 @@
|
||||||
|
2007-03-28 Simon Martin <simartin@users.sourceforge.net>
|
||||||
|
|
||||||
|
PR c++/29077
|
||||||
|
* decl.c (grokfndecl): Properly setup decl if it is a constructor or a
|
||||||
|
destructor.
|
||||||
|
|
||||||
2007-03-28 Douglas Gregor <doug.gregor@gmail.com>
|
2007-03-28 Douglas Gregor <doug.gregor@gmail.com>
|
||||||
|
|
||||||
* parser.c (struct cp_parser): Update comment for
|
* parser.c (struct cp_parser): Update comment for
|
||||||
|
|
|
@ -5981,6 +5981,20 @@ grokfndecl (tree ctype,
|
||||||
if (TYPE_VOLATILE (type))
|
if (TYPE_VOLATILE (type))
|
||||||
TREE_THIS_VOLATILE (decl) = 1;
|
TREE_THIS_VOLATILE (decl) = 1;
|
||||||
|
|
||||||
|
/* Setup decl according to sfk. */
|
||||||
|
switch (sfk)
|
||||||
|
{
|
||||||
|
case sfk_constructor:
|
||||||
|
case sfk_copy_constructor:
|
||||||
|
DECL_CONSTRUCTOR_P (decl) = 1;
|
||||||
|
break;
|
||||||
|
case sfk_destructor:
|
||||||
|
DECL_DESTRUCTOR_P (decl) = 1;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
if (friendp
|
if (friendp
|
||||||
&& TREE_CODE (orig_declarator) == TEMPLATE_ID_EXPR)
|
&& TREE_CODE (orig_declarator) == TEMPLATE_ID_EXPR)
|
||||||
{
|
{
|
||||||
|
@ -6168,12 +6182,7 @@ grokfndecl (tree ctype,
|
||||||
return decl;
|
return decl;
|
||||||
|
|
||||||
if (ctype != NULL_TREE)
|
if (ctype != NULL_TREE)
|
||||||
{
|
grokclassfn (ctype, decl, flags);
|
||||||
if (sfk == sfk_constructor)
|
|
||||||
DECL_CONSTRUCTOR_P (decl) = 1;
|
|
||||||
|
|
||||||
grokclassfn (ctype, decl, flags);
|
|
||||||
}
|
|
||||||
|
|
||||||
decl = check_explicit_specialization (orig_declarator, decl,
|
decl = check_explicit_specialization (orig_declarator, decl,
|
||||||
template_count,
|
template_count,
|
||||||
|
|
|
@ -1,3 +1,8 @@
|
||||||
|
2007-03-28 Simon Martin <simartin@users.sourceforge.net>
|
||||||
|
|
||||||
|
PR c++/29077
|
||||||
|
* g++.dg/parse/constructor3.C: New test.
|
||||||
|
|
||||||
2007-03-28 Eric Botcazou <ebotcazou@adacore.com>
|
2007-03-28 Eric Botcazou <ebotcazou@adacore.com>
|
||||||
|
|
||||||
* gnat.dg/thin_pointer.ad[sb]: New test.
|
* gnat.dg/thin_pointer.ad[sb]: New test.
|
||||||
|
|
|
@ -0,0 +1,14 @@
|
||||||
|
/* PR c++/29077 */
|
||||||
|
/* { dg-do "compile" } */
|
||||||
|
|
||||||
|
class c {
|
||||||
|
c();
|
||||||
|
c(const c&);
|
||||||
|
~c();
|
||||||
|
};
|
||||||
|
|
||||||
|
namespace m {
|
||||||
|
c::c() {} /* { dg-error "c::c" } */
|
||||||
|
c::c(const c&) {} /* { dg-error "c::c" } */
|
||||||
|
c::~c() {} /* { dg-error "c::~c" } */
|
||||||
|
}
|
Loading…
Reference in New Issue