Skip to content

parser error with const reference to std::string #477

@Bertk

Description

@Bertk

Hi ,
I extended the samples within cxx-squid\src\test\resources\parser\own folder and added 2 class member functions (Bertk@33f3d7c)
The first one passes the second fails. I observed this also in our legacy code many times.
Do you have any idea how to fix this issue?

testParsingOnDiverseSourceFiles(org.sonar.cxx.parser.CxxParserTest)  Time elapsed: 0.016 sec  <<< ERROR!
com.sonar.sslr.api.RecognitionException: Parse error at line 17 column 46:

   10: ;
   11:
   12: void ClientContextRegistry::onChanged(const ClientIdentifier & aIdentifier_in)
   13: {
   14:  std::cout << aIdentifier_in.unique_id << std::endl;
   15: }
   16:
  -->  bool PropertyEdit::CheckForCharactersInString(const std::string& str_in)
   18: {
   19:  int aLen = str_in.length;
   20:  for (int i = 0; i<aLen; i++)
   21:  {

        at org.sonar.sslr.internal.vm.Machine.parse(Machine.java:74)
        at com.sonar.sslr.impl.Parser.parse(Parser.java:87)
        at com.sonar.sslr.impl.Parser.parse(Parser.java:72)
        at org.sonar.cxx.parser.CxxParserTest.testParsingOnDiverseSourceFiles(CxxParserTest.java:54)

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions