summaryrefslogtreecommitdiff
path: root/tests/test_domain_cpp.py
diff options
context:
space:
mode:
authorJakob Lykke Andersen <Jakob@caput.dk>2017-11-26 21:41:15 +0100
committerJakob Lykke Andersen <Jakob@caput.dk>2017-11-26 21:41:15 +0100
commitd6ec677c6161f3fad1d1848f36feb5f35058e914 (patch)
tree44bb0517542e66e9989ce1717cf87eee2b9ae082 /tests/test_domain_cpp.py
parente7ba2abfb2416115fb5ed96eee1f3b27cd263c6f (diff)
downloadsphinx-git-d6ec677c6161f3fad1d1848f36feb5f35058e914.tar.gz
C++, parse decltype(<expr>)
Fixes sphinx-doc/sphinx#4094
Diffstat (limited to 'tests/test_domain_cpp.py')
-rw-r--r--tests/test_domain_cpp.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/test_domain_cpp.py b/tests/test_domain_cpp.py
index 3fdb1ae23..8c838fcf8 100644
--- a/tests/test_domain_cpp.py
+++ b/tests/test_domain_cpp.py
@@ -235,6 +235,7 @@ def test_type_definitions():
check("type", "bool ::B::b", {1:"B::b", 2:"N1B1bE"})
check('type', 'A = B', {2:'1A'})
+ check('type', 'A = decltype(b)', {2:'1A'})
# from breathe#267 (named function parameters for function pointers
check('type', 'void (*gpio_callback_t)(struct device *port, uint32_t pin)',
@@ -389,6 +390,8 @@ def test_function_definitions():
check('function', 'extern int f()', {1:'f', 2:'1fv'})
+ check('function', 'decltype(auto) f()', {1: 'f', 2:"1fv"})
+
# TODO: make tests for functions in a template, e.g., Test<int&&()>
# such that the id generation for function type types is correct.
@@ -466,6 +469,10 @@ def test_class_definitions():
check('class', 'A : B, C...', {1:'A', 2:'1A'})
check('class', 'A : B..., C', {1:'A', 2:'1A'})
+ # from #4094
+ check('class', 'template<class, class = std::void_t<>> has_var', {2:'I00E7has_var'})
+ check('class', 'template<class T> has_var<T, std::void_t<decltype(&T::var)>>', {2:'I0E7has_varI1TNSt6void_tIDTadN1T3varEEEEE'})
+
def test_enum_definitions():
check('enum', 'A', {2:"1A"})