Details
-
Type:
Bug
-
Status: Closed (View Workflow)
-
Priority:
Medium
-
Resolution: Fixed
-
Affects Version/s: 6.20/04
-
Labels:None
-
Environment:
Fedora 31
gcc 9.3.1
clang 9.0.1
-
Development:
Description
This works as expected:
#include <TH1F.h>
|
|
class MyTH1F : public TH1F |
{
|
public: |
using TH1F::TH1F;
|
};
|
|
int main() |
{
|
MyTH1F h("name", "title", 100, 0, 100); |
}
|
if I remove the using directive I get:
a.cpp:11:40: error: no matching function for call to 'MyTH1F::MyTH1F(const char [5], const char [6], int, int, int)' |
11 | MyTH1F h("name", "title", 100, 0, 100); |
| ^
|
a.cpp:3:7: note: candidate: 'MyTH1F::MyTH1F()' |
3 | class MyTH1F : public TH1F |
| ^~~~~~
|
a.cpp:3:7: note: candidate expects 0 arguments, 5 provided |
a.cpp:3:7: note: candidate: 'MyTH1F::MyTH1F(const MyTH1F&)' |
a.cpp:3:7: note: candidate expects 1 argument, 5 provided |
a.cpp:3:7: note: candidate: 'MyTH1F::MyTH1F(MyTH1F&&)' |
a.cpp:3:7: note: candidate expects 1 argument, 5 provided |
|
as expected.
The problem is if I do this:
import ROOT |
|
ROOT.gInterpreter.Declare(
|
""" |
class MyTH1F : public TH1F |
{
|
public: |
using TH1F::TH1F;
|
};
|
""") |
|
h = ROOT.MyTH1F("name", "title", 100, 0, 100) |
I get the same error as if the using directive were not present
TypeError: none of the 3 overloaded methods succeeded. Full details: |
MyTH1F::MyTH1F() =>
|
takes at most 0 arguments (5 given) |
MyTH1F::MyTH1F(const MyTH1F&) => |
takes at most 1 arguments (5 given) |
MyTH1F::MyTH1F(MyTH1F&&) =>
|
takes at most 1 arguments (5 given) |