| Summary: | Using-declaration for template functions does not work | ||
|---|---|---|---|
| Product: | gcc | Reporter: | comer |
| Component: | c++ | Assignee: | Kriang Lerdsuwanakij <lerdsuwa> |
| Status: | RESOLVED FIXED | ||
| Severity: | normal | CC: | gcc-bugs, lerdsuwa, pallas, pinskia, reichelt |
| Priority: | P3 | Keywords: | monitored, rejects-valid |
| Version: | 3.2 | ||
| Target Milestone: | 3.4.0 | ||
| Host: | Target: | ||
| Build: | Known to work: | ||
| Known to fail: | Last reconfirmed: | 2003-10-14 19:14:10 | |
| Attachments: | tst51.cpp | ||
Fix:
struct A
{
template<class R>
void F(R)
{
}
};
struct B: private A
{
//using A::F;
template<class R>
void F(R r)
{
A::F(r);
}
};
int main()
{
B b;
b.F(3);
return 0;
}
State-Changed-From-To: open->analyzed
State-Changed-Why: COnfirmed for all versions of gcc from 2.95 to present
mainline.
still happens on the mainline (20030607). This is actually an access checking problem. Krian, you are the expert resident for this, so I add you to the CCs. W. Will investigate. Patch in progress. Subject: Bug 9810 CVSROOT: /cvs/gcc Module name: gcc Changes by: lerdsuwa@gcc.gnu.org 2003-11-02 14:17:39 Modified files: gcc/cp : ChangeLog call.c gcc/testsuite : ChangeLog gcc/testsuite/g++.old-deja/g++.other: access11.C Added files: gcc/testsuite/g++.dg/template: using8.C Log message: PR c++/9810 * call.c (build_over_call): Check access using primary template if FN is a member function template. * g++.dg/template/using8.C: New test. * g++.old-deja/g++.other/access11.C: Adjust expected error location. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&r1=1.3747&r2=1.3748 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/call.c.diff?cvsroot=gcc&r1=1.440&r2=1.441 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.3165&r2=1.3166 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/template/using8.C.diff?cvsroot=gcc&r1=NONE&r2=1.1 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.old-deja/g++.other/access11.C.diff?cvsroot=gcc&r1=1.2&r2=1.3 Fixed in the mainline. |
struct A { template<class R> void F(R) { // line # 5 } }; struct B: private A { using A::F; // line # 11 }; int main() { B b; b.F(3); // line # 17 return 0; } Release: 3.2 20020818 (prerelease) Environment: Windows, Cygwin How-To-Repeat: g++ tst51.cpp