Bug 63532 - Cannot increase access of member function template.
Summary: Cannot increase access of member function template.
Status: NEW
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 4.9.1
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords: rejects-valid
: 104488 (view as bug list)
Depends on:
Blocks: pmf, ptmf
  Show dependency treegraph
 
Reported: 2014-10-14 09:45 UTC by Ignacy Gawędzki
Modified: 2022-02-10 22:03 UTC (History)
3 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail: 5.4.0, 6.2.0
Last reconfirmed: 2021-08-04 00:00:00


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ignacy Gawędzki 2014-10-14 09:45:08 UTC
The following code is rejected by GCC while it is accepted by Clang.

struct Foo {
  template <typename>
  void	meth();
};

struct Bar : private Foo {
  using Foo::meth;
};

int main()
{
  (void) &Bar::meth<int>;
}

GCC accepts a variant where Foo::meth is a plain (i.e., non-template) member function.
Comment 1 Jonathan Wakely 2014-10-14 10:52:46 UTC
G++ accepts the using declaration but it seems to have no effect when forming a pointer to member for a specialization:

in.cc: In function ‘int main()’:
in.cc:3:11: error: ‘void Foo::meth() [with <template-parameter-1-1> = int]’ is inaccessible
   void    meth();
           ^
in.cc:12:16: error: within this context
   (void) &Bar::meth<int>;
                ^
Comment 2 Andrew Pinski 2021-12-11 08:56:38 UTC
This is similar issue to PR 56152 (static call vs non-static).
Comment 3 Andrew Pinski 2022-02-10 22:03:11 UTC
*** Bug 104488 has been marked as a duplicate of this bug. ***