File tree 4 files changed +51
-0
lines changed
4 files changed +51
-0
lines changed Original file line number Diff line number Diff line change @@ -5762,6 +5762,7 @@ cin_is_cpp_namespace(char_u *s)
5762
5762
{
5763
5763
char_u * p ;
5764
5764
int has_name = FALSE;
5765
+ int has_name_start = FALSE;
5765
5766
5766
5767
s = cin_skipcomment (s );
5767
5768
if (STRNCMP (s , "namespace" , 9 ) == 0 && (s [9 ] == NUL || !vim_iswordc (s [9 ])))
@@ -5780,10 +5781,18 @@ cin_is_cpp_namespace(char_u *s)
5780
5781
}
5781
5782
else if (vim_iswordc (* p ))
5782
5783
{
5784
+ has_name_start = TRUE;
5783
5785
if (has_name )
5784
5786
return FALSE; /* word character after skipping past name */
5785
5787
++ p ;
5786
5788
}
5789
+ else if (p [0 ] == ':' && p [1 ] == ':' && vim_iswordc (p [2 ]))
5790
+ {
5791
+ if (!has_name_start || has_name )
5792
+ return FALSE;
5793
+ /* C++ 17 nested namespace */
5794
+ p += 3 ;
5795
+ }
5787
5796
else
5788
5797
{
5789
5798
return FALSE;
Original file line number Diff line number Diff line change @@ -1932,6 +1932,26 @@ namespace test
1932
1932
{
1933
1933
111111111111111111;
1934
1934
}
1935
+ namespace test::cpp17
1936
+ {
1937
+ 111111111111111111;
1938
+ }
1939
+ namespace ::incorrectcpp17
1940
+ {
1941
+ 111111111111111111;
1942
+ }
1943
+ namespace test::incorrectcpp17::
1944
+ {
1945
+ 111111111111111111;
1946
+ }
1947
+ namespace test:incorrectcpp17
1948
+ {
1949
+ 111111111111111111;
1950
+ }
1951
+ namespace test:::incorrectcpp17
1952
+ {
1953
+ 111111111111111111;
1954
+ }
1935
1955
namespace{
1936
1956
111111111111111111;
1937
1957
}
Original file line number Diff line number Diff line change @@ -1730,6 +1730,26 @@ namespace test
1730
1730
{
1731
1731
111111111111111111;
1732
1732
}
1733
+ namespace test::cpp17
1734
+ {
1735
+ 111111111111111111;
1736
+ }
1737
+ namespace ::incorrectcpp17
1738
+ {
1739
+ 111111111111111111;
1740
+ }
1741
+ namespace test::incorrectcpp17::
1742
+ {
1743
+ 111111111111111111;
1744
+ }
1745
+ namespace test:incorrectcpp17
1746
+ {
1747
+ 111111111111111111;
1748
+ }
1749
+ namespace test:::incorrectcpp17
1750
+ {
1751
+ 111111111111111111;
1752
+ }
1733
1753
namespace{
1734
1754
111111111111111111;
1735
1755
}
Original file line number Diff line number Diff line change @@ -764,6 +764,8 @@ static char *(features[]) =
764
764
765
765
static int included_patches [] =
766
766
{ /* Add new patch number below this line */
767
+ /**/
768
+ 92 ,
767
769
/**/
768
770
91 ,
769
771
/**/
You can’t perform that action at this time.
0 commit comments