Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Header with C++ namespace declarations is wrongly identified as C #1250

Closed
gsauthof opened this issue Jun 4, 2014 · 4 comments
Closed

Header with C++ namespace declarations is wrongly identified as C #1250

gsauthof opened this issue Jun 4, 2014 · 4 comments

Comments

@gsauthof
Copy link

gsauthof commented Jun 4, 2014

This search

https://github.com/gsauthof/imapdl/search?l=c

lists lex_util.h - which clearly is C++ - because it has some C++ specific constructs, e.g.

#include <ostream>

(C++ STL header)

or

std::ostream

(namespace usage in a argument declaration)

@pchaigno
Copy link
Contributor

pchaigno commented Jun 4, 2014

The kind of specific constructs you mentioned could be handled with heuristics.
#1036 adds a few of them to distinguish C, C++ and C#. Maybe it could include this case.
@DX-MON Any insights?

@dragonmux
Copy link
Contributor

Looks like my pull request is being benchmarked now so we should see it merged shortly.. my heuristics would find your use of STL and mark the code as C++ and likewise any header that defines a class or such.. as long as that header contains no Obj-C specific markup. To be sure, though, I may well add an extra heuristic to my pull request that handles std:: being present and automatically handling that as C++.

@pchaigno
Copy link
Contributor

pchaigno commented Jun 5, 2014

To be sure, though, I may well add an extra heuristic to my pull request that handles std:: being present and automatically handling that as C++.

That would be good. I tested your PR on the file and currently it is still recognized as C :/ (unless I missed something...).

@bkeepers
Copy link
Contributor

We're tracking progress for this fix in #1626.

@github-linguist github-linguist locked as resolved and limited conversation to collaborators Jun 17, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants