Skip to content

Conversation

firewave
Copy link
Collaborator

No description provided.

@firewave
Copy link
Collaborator Author

Taken from danmar/cppcheck#4785.

@firewave
Copy link
Collaborator Author

I might spin out the class into a separate repo (as public domain) as this seems like something useful in general.

@firewave
Copy link
Collaborator Author

This fails to compile with GCC before 15:

simplecpp.cpp:1742:37: error: operands to ‘?:’ have different types ‘const simplecpp::constness_ptr<simplecpp::Token>’ and ‘std::nullptr_t’
 1742 |                 valueToken = argtok ? argtok->next : nullptr;
      |                              ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~

And with Visual Studio:

     6>C:\a\simplecpp\simplecpp\simplecpp.cpp(1742,54): error C2446: ':': no conversion from 'nullptr' to 'const simplecpp::constness_ptr<simplecpp::Token>' [C:\a\simplecpp\simplecpp\simplecpp_obj.vcxproj]
             C:\a\simplecpp\simplecpp\simplecpp.cpp(1742,54):
             Constructor for class 'simplecpp::constness_ptr<simplecpp::Token>' is declared 'explicit'

mitigated `misc-const-correctness` clang-tidy false positive

fixed `readability-math-missing-parentheses` clang-tidy warnings

.clang-tidy: disabled `readability-use-concise-preprocessor-directives`

split up Clang warnings in CMake

disabled `-Wnrvo` Clang warning

mitigated `misc-const-correctness` clang-tidy warnings

clang-tidy.yml: updated to Clang 21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant