This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
c++/8982: "using foo::operator+" doesn't parse
- From: dean at foster dot net
- To: gcc-gnats at gcc dot gnu dot org
- Date: 17 Dec 2002 16:45:00 -0000
- Subject: c++/8982: "using foo::operator+" doesn't parse
- Reply-to: dean at foster dot net
>Number: 8982
>Category: c++
>Synopsis: "using foo::operator+" doesn't parse
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: unassigned
>State: open
>Class: rejects-legal
>Submitter-Id: net
>Arrival-Date: Tue Dec 17 08:46:01 PST 2002
>Closed-Date:
>Last-Modified:
>Originator: dean@foster.net
>Release: gcc 3.2
>Organization:
>Environment:
linux
>Description:
if you want to inject an operator from a namespace into a file, you need to include the entire namespace. I don't think this is correct. See below for an example. The line with is incorrectly handled is marked:
namespace foo{
template<class X>
int bar(X x);
template<class X>
int operator- (X x);
}
int main()
{
using foo::bar; // works correctly
using foo::operator-; // ** complains as syntax error
using namespace foo; // will inject operator-
}
>How-To-Repeat:
namespace foo{
template<class X>
int operator- (X x);
}
int main()
{
using foo::operator-; // ** complains as syntax error
}
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted: