c++/8982: "using foo::operator+" doesn't parse

dean@foster.net dean@foster.net
Tue Dec 17 08:46:00 GMT 2002


>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:



More information about the Gcc-prs mailing list