decl.c (grokdeclarator): Issue errors on namespace qualified declarators in parameter lists or in class...
1998-08-12 Mark Mitchell <mark@markmitchell.com> * decl.c (grokdeclarator): Issue errors on namespace qualified declarators in parameter lists or in class scope. From-SVN: r21684
This commit is contained in:
parent
23a05d03eb
commit
05008fb97d
@ -1,3 +1,8 @@
|
|||||||
|
1998-08-12 Mark Mitchell <mark@markmitchell.com>
|
||||||
|
|
||||||
|
* decl.c (grokdeclarator): Issue errors on namespace qualified
|
||||||
|
declarators in parameter lists or in class scope.
|
||||||
|
|
||||||
1998-08-09 Mark Mitchell <mark@markmitchell.com>
|
1998-08-09 Mark Mitchell <mark@markmitchell.com>
|
||||||
|
|
||||||
* pt.c (check_explicit_specialization): Don't abort on bogus
|
* pt.c (check_explicit_specialization): Don't abort on bogus
|
||||||
|
@ -10125,7 +10125,7 @@ grokdeclarator (declarator, declspecs, decl_context, initialized, attrlist)
|
|||||||
|
|
||||||
if (decl_context == PARM)
|
if (decl_context == PARM)
|
||||||
{
|
{
|
||||||
if (ctype)
|
if (ctype || in_namespace)
|
||||||
error ("cannot use `::' in parameter declaration");
|
error ("cannot use `::' in parameter declaration");
|
||||||
|
|
||||||
/* A parameter declared as an array of T is really a pointer to T.
|
/* A parameter declared as an array of T is really a pointer to T.
|
||||||
@ -10179,6 +10179,12 @@ grokdeclarator (declarator, declspecs, decl_context, initialized, attrlist)
|
|||||||
are error_mark_node, for example. */
|
are error_mark_node, for example. */
|
||||||
decl = NULL_TREE;
|
decl = NULL_TREE;
|
||||||
}
|
}
|
||||||
|
else if (in_namespace)
|
||||||
|
{
|
||||||
|
/* Something like struct S { int N::j; }; */
|
||||||
|
cp_error ("invalid use of `::'");
|
||||||
|
decl = NULL_TREE;
|
||||||
|
}
|
||||||
else if (TREE_CODE (type) == FUNCTION_TYPE)
|
else if (TREE_CODE (type) == FUNCTION_TYPE)
|
||||||
{
|
{
|
||||||
int publicp = 0;
|
int publicp = 0;
|
||||||
|
10
gcc/testsuite/g++.old-deja/g++.ns/bogus1.C
Normal file
10
gcc/testsuite/g++.old-deja/g++.ns/bogus1.C
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
// Build don't link:
|
||||||
|
|
||||||
|
namespace N {}
|
||||||
|
|
||||||
|
void f(int N::k); // ERROR - cannot use `::' in parameter declaration
|
||||||
|
|
||||||
|
class Foo
|
||||||
|
{
|
||||||
|
int N::j; // ERROR - invalid use of `::'
|
||||||
|
};
|
Loading…
Reference in New Issue
Block a user