-
Notifications
You must be signed in to change notification settings - Fork 58
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
Error in _add_use #80
Comments
That seems to be the related code: #ifndef NUMERICTYPEINFO_H
#define NUMERICTYPEINFO_H
#include <string>
#include <limits>
namespace PlatformSupport {
template <typename T>
std::string PrintNumericTypeInfo(const char *pTypename)
{
if (std::numeric_limits<T>::is_integer)
{
if (std::numeric_limits<T>::is_signed)
{
return ::extstl::toString("%s: MIN=%lld,MAX=%lld",
pTypename, (long long)std::numeric_limits<T>::min(), (long long)std::numeric_limits<T>::max());
}
else
{
return ::extstl::toString("%s: MAX=%llu",
pTypename, (unsigned long long)std::numeric_limits<T>::max());
}
}
else
{
return ::extstl::toString("%s: MIN=%Le,MAX=%Le,EPS=%Le",
pTypename, (long double)std::numeric_limits<T>::min(), (long double)std::numeric_limits<T>::max(), (long double)std::numeric_limits<T>::epsilon());
}
}
}
#endif //NUMERICTYPEINFO_H
|
I can't seem to reproduce the stack trace.
|
I confirm... I was reducing the example too much. I get many failures on my code base :-( |
I also got that same error. I tried to debug it and it seems that this error happens when CppClean the first line of a function template defined inline which contains a using declaration. Unfortunately I can't share the offending code. I'll try to reproduce bellow the structure of the code (with fake names) where the
The namespace I'm running CppClean with Python 2.7.10. I noticed the following comments on
Could those be the cause for this error? I'll try to see if I can build a smaller and complete code example which would trigger that |
Now I also managed to extract a self-contained example which consists out of two headers, running cppclean CW.h CW.h #ifndef HEADER2
#define HEADER2
#include "C.h"
namespace MyNamespace
{
namespace BRK
{
class CW : public CI
{
int cf()
{
return MyNamespace::BRK::CI::cf();
}
};
}
}
#endif C.h #ifndef HEADER1
#define HEADER1
namespace MyNamespace
{
namespace BRK
{
class CI
{
public:
int cf();
};
}
}
#endif |
Hi, I made a fix for this problem. It's not perfect but it should at least fix the crash. Can you try on your code to see if it's ok ? |
I've tried this fix on my code and the The Recall that the namespace |
My bad, I only look at the sample from amai2012, I didn't check the other samples. My fix only works for some simple and specific patterns. We will need something more complex to handle the other cases. |
@r-e-d: No problem, I've commented on this issue just because I thought it could be the same problem. If needed, I can open a new issue for the example code I've posted. Just let me know if that would be better. |
This time, my fix should handle the more general cases :) |
This new fix solved the problem for me. Thanks! 👍 |
I'll report further issues in another ticket, so close that one. |
Running 793bd44 on my 64bit cygwin I get an error somewhere in the middle of a run (--verbose is active):
The text was updated successfully, but these errors were encountered: