Commit a9699f74 authored by Ashwin Srinath's avatar Ashwin Srinath Committed by Stefan Behnel

Allow const declarations in nested template arguments (GH-3886)

Closes https://github.com/cython/cython/issues/1355
parent 58955604
......@@ -2678,7 +2678,7 @@ def looking_at_expr(s):
s.put_back(*saved)
elif s.sy == '[':
s.next()
is_type = s.sy == ']'
is_type = s.sy == ']' or not looking_at_expr(s) # could be a nested template type
s.put_back(*saved)
dotted_path.reverse()
......
# tag: cpp
# mode: compile
from libcpp.vector cimport vector
cdef extern from *:
cdef cppclass Foo[T]:
pass
cdef cppclass Bar:
pass
cdef vector[vector[int]] a
cdef vector[vector[const int]] b
cdef vector[vector[vector[int]]] c
cdef vector[vector[vector[const int]]] d
cdef Foo[Foo[Bar]] e
cdef Foo[Foo[const Bar]] f
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment