-
Notifications
You must be signed in to change notification settings - Fork 15
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
shorter error messages? #56
Comments
Hm. How exactly? I'm interested, but I don't see how. The usual techniques -- SFINAE/concept constraints and static_asserts won't really work very well here, because of the loose matching of attribute types. If I pass in a |
Well, I did actually find a place to put a static_assert that gives a likely-useful hint at the kind of error above. So, Let's keep this issue open; please post more examples as they come up. |
…ce of compilation failure there -- attribute incompatibility. Partially addresses #56.
From my experience, |
I don't know of any snippet of code guaranteed to stop the compile on any implementation, and I tried putting a constraint on the use of the bad index after the static assert, and it did not stop the build, or produce any fewer diagnostics. I'm open to suggestions though. |
Also, maybe after the new assert, use some redundant template instantiation that would display (as error message) the type of the default attribute and the type of the struct that I wanted to parse into. In a nested parser it is far from obvious what structure is being parsed into. |
…se the types to be printed in some places after a static_assert failure. Partially addresses #56.
another example with huge error messages in GCC: #include <boost/parser/parser.hpp>
namespace bp = boost::parser;
int main()
{
auto myParser = (bp::lower >> bp::lower >> -bp::digi);
std::string input = "MM2";
int result;
auto b = bp::parse(input, myParser, bp::ws, result);
if (b)
std::cout << ":-) " << result << std::endl;
else
std::cout << ":-(" << std::endl;
} |
When I compile the example from the other issue:
I get the following error message. It is very long, and I am convinced that it could be made shorter with some metapprogramming tricks.
The text was updated successfully, but these errors were encountered: