-
Notifications
You must be signed in to change notification settings - Fork 65
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 SQLParser.cpp #420
Comments
Hi @AhmedEleliemy, unfortunately, I cannot reprocude this problem. With the lastest commit on main, the build succeeds and tests pass on my system. Based on the error output, I suspect that something is going wrong with ANTLR. Have you tried cleaing all dependencies and rebuilding, i.e., |
I can reproduce if I specify ANTLR 4.9.3 in build.sh. Did you modify build.sh or could it be that some other ANTLR installed on your system is interfering ? |
If you were trying out 4.9.3 and switched back to 4.9.2 in build.sh you also need to remove the install_success file for it to get reinstalled ;-)
|
There is actually a bug too. |
@pdamme @corepointer @DerSchmidt thank you all. |
I just checked out @DerSchmidt 's PR #422 which seems to be doing fine. I'll merge it soon© Before change #422: ANTLR 4.9.2 == good, ANTLR 4.9.3 == bad.
|
ANTLR4 is switching from using its own Any implementation to std::any. Std::any however doesn't support is() and as(). This change is from ANTLR Version 4.10 onwards. |
When @AhmedEleliemy said he recompiled everything with 4.10.1 because he has troubles with GCC 11 I automatically assumed this to be a reference to the GCC version aswell. But there's no GCC 4.10. My bad 😇 |
[DAPHNE-#420]: ANTLR Any Conversion.
I am trying to compile daphne. However, I am getting the error below from SQLParser.cpp
@pdamme @corepointer any suggestions??
In file included from /daphne/src/parser/sql/SQLVisitor.h:19,
from /daphne/src/parser/sql/SQLParser.cpp:19:
/daphne/src/parser/ParserUtils.h: In member function 'mlir::Value ParserUtils::valueOrError(antlrcpp::Any)':
/daphne/src/parser/ParserUtils.h:209:14: error: 'using Any = class std::any' {aka 'class std::any'} has no member named 'is'
209 | if(a.ismlir::Value())
| ^~
/daphne/src/parser/ParserUtils.h:209:28: error: expected primary-expression before '>' token
209 | if(a.ismlir::Value())
| ^
/daphne/src/parser/ParserUtils.h:209:30: error: expected primary-expression before ')' token
209 | if(a.ismlir::Value())
| ^
/daphne/src/parser/ParserUtils.h:210:22: error: 'using Any = class std::any' {aka 'class std::any'} has no member named 'as'
210 | return a.asmlir::Value();
| ^~
/daphne/src/parser/ParserUtils.h:210:36: error: expected primary-expression before '>' token
210 | return a.asmlir::Value();
| ^
/daphne/src/parser/ParserUtils.h:210:38: error: expected primary-expression before ')' token
210 | return a.asmlir::Value();
| ^
/daphne/src/parser/sql/SQLParser.cpp: In member function 'mlir::Value SQLParser::parseStreamFrame(mlir::OpBuilder&, std::istream&, const string&)':
/daphne/src/parser/sql/SQLParser.cpp:52:14: error: 'using Any = class std::any' {aka 'class std::any'} has no member named 'is'
52 | if(a.ismlir::Value()){
| ^~
/daphne/src/parser/sql/SQLParser.cpp:52:28: error: expected primary-expression before '>' token
52 | if(a.ismlir::Value()){
| ^
/daphne/src/parser/sql/SQLParser.cpp:52:30: error: expected primary-expression before ')' token
52 | if(a.ismlir::Value()){
| ^
/daphne/src/parser/sql/SQLParser.cpp:53:20: error: 'using Any = class std::any' {aka 'class std::any'} has no member named 'as'
53 | return a.asmlir::Value();
| ^~
/daphne/src/parser/sql/SQLParser.cpp:53:34: error: expected primary-expression before '>' token
53 | return a.asmlir::Value();
| ^
/daphne/src/parser/sql/SQLParser.cpp:53:36: error: expected primary-expression before ')' token
53 | return a.asmlir::Value();
| ^
[44/93] Building CXX object src/parser/sql/CMakeFiles/SQLParser.dir/SQLVisitor.cpp.o
FAILED: src/parser/sql/CMakeFiles/SQLParser.dir/SQLVisitor.cpp.o
/usr/bin/c++ -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/daphne/thirdparty/llvm-project/llvm/include -I/daphne/thirdparty/build/llvm-project/include -I/daphne/thirdparty/llvm-project/mlir/include -I/daphne/thirdparty/build/llvm-project/tools/mlir/include -I/daphne/thirdparty/installed/include -I/daphne/thirdparty/installed/include/openblas -I/daphne/src -I/daphne/build/src -I/daphne/build -I/daphne/thirdparty/installed/include/antlr4-runtime -I/daphne/build/antlr4_generated_src/SQLGrammar -fPIC -fvisibility-inlines-hidden -Werror=date-time -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -Wimplicit-fallthrough -Wno-class-memaccess -Wno-redundant-move -Wno-pessimizing-move -Wno-noexcept-type -Wdelete-non-virtual-dtor -Wsuggest-override -Wno-comment -Wmisleading-indentation -fdiagnostics-color -ffunction-sections -fdata-sections -O3 -DNDEBUG -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -std=gnu++17 -MD -MT src/parser/sql/CMakeFiles/SQLParser.dir/SQLVisitor.cpp.o -MF src/parser/sql/CMakeFiles/SQLParser.dir/SQLVisitor.cpp.o.d -o src/parser/sql/CMakeFiles/SQLParser.dir/SQLVisitor.cpp.o -c /daphne/src/parser/sql/SQLVisitor.cpp
In file included from /daphne/src/parser/sql/SQLVisitor.h:19,
from /daphne/src/parser/sql/SQLVisitor.cpp:19:
/daphne/src/parser/ParserUtils.h: In member function 'mlir::Value ParserUtils::valueOrError(antlrcpp::Any)':
/daphne/src/parser/ParserUtils.h:209:14: error: 'using Any = class std::any' {aka 'class std::any'} has no member named 'is'
209 | if(a.ismlir::Value())
| ^~
/daphne/src/parser/ParserUtils.h:209:28: error: expected primary-expression before '>' token
209 | if(a.ismlir::Value())
| ^
/daphne/src/parser/ParserUtils.h:209:30: error: expected primary-expression before ')' token
209 | if(a.ismlir::Value())
| ^
/daphne/src/parser/ParserUtils.h:210:22: error: 'using Any = class std::any' {aka 'class std::any'} has no member named 'as'
210 | return a.asmlir::Value();
| ^~
/daphne/src/parser/ParserUtils.h:210:36: error: expected primary-expression before '>' token
210 | return a.asmlir::Value();
| ^
/daphne/src/parser/ParserUtils.h:210:38: error: expected primary-expression before ')' token
210 | return a.asmlir::Value();
| ^
/daphne/src/parser/sql/SQLVisitor.cpp: In member function 'virtual antlrcpp::Any SQLVisitor::visitGroupByClause(SQLGrammarParser::GroupByClauseContext*)':
/daphne/src/parser/sql/SQLVisitor.cpp:660:53: error: no match for 'operator=' (operand types are 'mlir::Value' and 'std::any')
660 | currentFrame = visit(ctx->havingClause());
| ^
In file included from /daphne/thirdparty/llvm-project/mlir/include/mlir/IR/BlockSupport.h:16,
from /daphne/thirdparty/llvm-project/mlir/include/mlir/IR/OperationSupport.h:18,
from /daphne/thirdparty/llvm-project/mlir/include/mlir/IR/Dialect.h:16,
from /daphne/thirdparty/llvm-project/mlir/include/mlir/IR/OpDefinition.h:22,
from /daphne/thirdparty/llvm-project/mlir/include/mlir/Interfaces/ControlFlowInterfaces.h:17,
from /daphne/src/ir/daphneir/Daphne.h:22,
from /daphne/src/parser/sql/SQLVisitor.cpp:18:
/daphne/thirdparty/llvm-project/mlir/include/mlir/IR/Value.h:86:10: note: candidate: 'constexpr mlir::Value& mlir::Value::operator=(const mlir::Value&)'
86 | Value &operator=(const Value &) = default;
| ^~~~~~~~
/daphne/thirdparty/llvm-project/mlir/include/mlir/IR/Value.h:86:20: note: no known conversion for argument 1 from 'std::any' to 'const mlir::Value&'
86 | Value &operator=(const Value &) = default;
The text was updated successfully, but these errors were encountered: