File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1955,7 +1955,7 @@ const Token * Variable::declEndToken() const
19551955{
19561956 Token const * declEnd = typeStartToken ();
19571957 while (declEnd && !Token::Match (declEnd, " [;,)={]" )) {
1958- if (declEnd->link () && Token::Match (declEnd," (|[" ))
1958+ if (declEnd->link () && Token::Match (declEnd," (|[|< " ))
19591959 declEnd = declEnd->link ();
19601960 declEnd = declEnd->next ();
19611961 }
Original file line number Diff line number Diff line change @@ -108,6 +108,7 @@ class TestConstructors : public TestFixture {
108108 TEST_CASE (initvar_2constructors); // BUG 2270353
109109 TEST_CASE (initvar_constvar);
110110 TEST_CASE (initvar_staticvar);
111+ TEST_CASE (initvar_brace_init);
111112 TEST_CASE (initvar_union);
112113 TEST_CASE (initvar_delegate); // ticket #4302
113114 TEST_CASE (initvar_delegate2);
@@ -1046,6 +1047,19 @@ class TestConstructors : public TestFixture {
10461047 }
10471048
10481049
1050+ void initvar_brace_init () { // #10142
1051+ check (" class C\n "
1052+ " {\n "
1053+ " public:\n "
1054+ " C() {}\n "
1055+ " \n "
1056+ " private:\n "
1057+ " std::map<int, double> * values_{};\n "
1058+ " };" );
1059+ ASSERT_EQUALS (" " , errout.str ());
1060+ }
1061+
1062+
10491063 void initvar_union () {
10501064 check (" class Fred\n "
10511065 " {\n "
You can’t perform that action at this time.
0 commit comments