yaml-cpp icon indicating copy to clipboard operation
yaml-cpp copied to clipboard

[clang-tidy] several const changes

Open neheb opened this issue 5 years ago • 4 comments
trafficstars

neheb avatar Jun 15 '20 23:06 neheb

Couldn't figure out how to move the GetStartTokenFor function in the namespace.

neheb avatar Jun 16 '20 20:06 neheb

What was the problem when trying to move GetStartTokenFor into the cpp file?

jbeder avatar Jun 17 '20 17:06 jbeder

src/scanner.cpp:22:69: error: definition of ‘YAML::Token::TYPE YAML::Scanner::GetStartTokenFor(YAML::Scanner::IndentMarker::INDENT_TYPE)’ is not in namespace enclosing ‘YAML::Scanner’ [-fpermissive]
   22 | Token::TYPE Scanner::GetStartTokenFor(IndentMarker::INDENT_TYPE type) {
      |                                                                     ^
src/scanner.cpp:22:13: error: no declaration matches ‘YAML::Token::TYPE YAML::Scanner::GetStartTokenFor(YAML::Scanner::IndentMarker::INDENT_TYPE)’
   22 | Token::TYPE Scanner::GetStartTokenFor(IndentMarker::INDENT_TYPE type) {
      |             ^~~~~~~
src/scanner.cpp:22:13: note: no functions named ‘YAML::Token::TYPE YAML::Scanner::GetStartTokenFor(YAML::Scanner::IndentMarker::INDENT_TYPE)’
In file included from src/scanner.cpp:5:
src/scanner.h:30:7: note: ‘class YAML::Scanner’ defined here
   30 | class Scanner {
      |       ^~~~~~~
src/scanner.cpp:22:39: error: ‘struct YAML::Scanner::IndentMarker’ is private within this context
   22 | Token::TYPE Scanner::GetStartTokenFor(IndentMarker::INDENT_TYPE type) {
      |                                       ^~~~~~~~~~~~
In file included from src/scanner.cpp:5:
src/scanner.h:48:10: note: declared private here
   48 |   struct IndentMarker {
      |          ^~~~~~~~~~~~
src/scanner.cpp: In member function ‘YAML::Scanner::IndentMarker* YAML::Scanner::PushIndentTo(int, YAML::Scanner::IndentMarker::INDENT_TYPE)’:
src/scanner.cpp:300:34: error: ‘GetStartTokenFor’ was not declared in this scope
  300 |   indent.pStartToken = PushToken(GetStartTokenFor(type));
      |                                  ^~~~~~~~~~~~~~~~
[5/9] Building CXX object CMakeFiles/yaml-cpp.dir/src/singledocparser.cpp.o

neheb avatar Jun 17 '20 20:06 neheb

Rebased.

neheb avatar Sep 29 '20 23:09 neheb