User account creation filtered due to spam.

Bug 46748 - Error "using typename" in template class
Summary: Error "using typename" in template class
Status: RESOLVED DUPLICATE of bug 14258
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 4.6.0
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-12-01 15:23 UTC by Ian Lance Taylor
Modified: 2010-12-01 15:46 UTC (History)
0 users

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ian Lance Taylor 2010-12-01 15:23:25 UTC
When I compile this test case:

template<typename T> class B 
{
 public:
  typedef int T2;
  static void F(T* f, T2* v);
};

template<typename T> class D : public B<T>
{
 public:
  using typename B<T>::T2;
  using B<T>::F;

  static void F2(T* f) {
    T2 v;
    F(f, &v);
  }
};

with current mainline, I get this:

foo.cc: In static member function ‘static void D<T>::F2(T*)’:
foo.cc:15:8: error: expected ‘;’ before ‘v’
foo.cc:16:11: error: ‘v’ was not declared in this scope

As far as I can see, this should work without an error.
Comment 1 Jonathan Wakely 2010-12-01 15:33:56 UTC
another dup of PR 14258 ?
Comment 2 Andrew Pinski 2010-12-01 15:46:29 UTC
(In reply to comment #1)
> another dup of PR 14258 ?

Yes.

*** This bug has been marked as a duplicate of bug 14258 ***