File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -341,6 +341,7 @@ class TestTokenizer : public TestFixture {
341341 TEST_CASE (simplifyOperatorName27);
342342 TEST_CASE (simplifyOperatorName28);
343343 TEST_CASE (simplifyOperatorName29); // spaceship operator
344+ TEST_CASE (simplifyOperatorName31); // #6342
344345
345346 TEST_CASE (simplifyOverloadedOperators1);
346347 TEST_CASE (simplifyOverloadedOperators2); // (*this)(123)
@@ -4834,6 +4835,17 @@ class TestTokenizer : public TestFixture {
48344835 ASSERT_EQUALS (code, tokenizeAndStringify (code));
48354836 }
48364837
4838+ void simplifyOperatorName31 () { // #6342
4839+ const char code[] = " template <typename T>\n "
4840+ " struct B {\n "
4841+ " typedef T A[3];\n "
4842+ " operator A& () { return x_; }\n "
4843+ " A x_;\n "
4844+ " };" ;
4845+ ASSERT_EQUALS (" template < typename T >\n struct B {\n\n operatorT ( & ( ) ) [ 3 ] { return x_ ; }\n T x_ [ 3 ] ;\n } ;" , tokenizeAndStringify (code));
4846+ ASSERT_EQUALS (" " , errout.str ());
4847+ }
4848+
48374849 void simplifyOperatorName10 () { // #8746
48384850 const char code1[] = " using a::operator=;" ;
48394851 ASSERT_EQUALS (" using a :: operator= ;" , tokenizeAndStringify (code1));
You can’t perform that action at this time.
0 commit comments