Skip to content

Commit

Permalink
Test for fix of lookup of templates of function with template args
Browse files Browse the repository at this point in the history
  • Loading branch information
wlav committed Feb 15, 2022
1 parent f4446b3 commit 0073df1
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 0 deletions.
1 change: 1 addition & 0 deletions doc/source/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ master: 2.3.0
* Pull forward upstream patch for PPC
* Only apply system_dirs patch (for asan) on Linux
* Add unloaded classes to namespaces in dir()
* Fix lookup of templates of function with template args


2021-11-14: 2.2.0
Expand Down
40 changes: 40 additions & 0 deletions test/test_regression.py
Original file line number Diff line number Diff line change
Expand Up @@ -1064,3 +1064,43 @@ def test37_array_of_pointers_argument(self):
res = ns.test(arr, b)

assert cppyy.addressof(res) == cppyy.addressof(arr)

def test38_template_of_function_with_templated_args(self):
"""Lookup of templates of function with templated args used to fail"""

import cppyy

cppyy.cppdef("""\
namespace parenthesis {
template<class T>
class F;
template<class T>
class V;
using i = F<void (int)>;
using v = F<void (V<int>)>;
using ii = F<void (int,int)>;
using iv = F<void (int,V<int>)>;
using vi = F<void (V<int>,int)>;
using vv = F<void (V<int>,V<int>)>;
using iii = F<void (int,int,int)>;
using ivi = F<void (int,V<int>,int)>;
using vii = F<void (V<int>,int,int)>;
using vvi = F<void (V<int>,V<int>,int)>;
using iiv = F<void (int,int,V<int>)>;
using ivv = F<void (int,V<int>,V<int>)>;
using viv = F<void (V<int>,int,V<int>)>;
using vvv = F<void (V<int>,V<int>,V<int>)>;
}""")

ns = cppyy.gbl.parenthesis

for t in ['i','v',
'ii', 'iv', 'vi', 'vv',
'iii', 'ivi', 'vii', 'vvi',
'iiv', 'ivv', 'viv', 'vvv']:
assert getattr(ns, t)

0 comments on commit 0073df1

Please sign in to comment.