constexpr-sql
constexpr-sql copied to clipboard
test/runner.sh failed to compile
‘cexpr::string<char, 4>’ is not a valid type for a template non-type parameter because it is not structural
was reported by GCC 10, which is probably caused by missing of operator<=>
for cexpr::string
.
By the way, I am very curious how you can bypass the bug 96331 in GCC, which is a serious one about CTAD and NTTP.
Enverienment:
gcc 10.2.0
linux 5.8.6-1-MANJARO
There is no error while GCC 9 is used.
Log:
constexpr-sql/tests $ ./runner.sh
Test Generator
Generating queries for "books" schema
Generating queries for "stories" schema
Generating queries for "authored" schema
Generating queries for "collected" schema
Test Generator
Generating queries for "books" schema
Generating queries for "stories" schema
Generating queries for "authored" schema
Generating queries for "collected" schema
Test Runner
Test queries selected
In file included from data.hpp:6,
from test.cpp:3:
../single-header/sql.hpp: In static member function ‘static constexpr auto sql::query<Str, Schemas>::parse_negation()’:
../single-header/sql.hpp:1514:51: error: ‘cexpr::string<char, 4>’ is not a valid type for a template non-type parameter because it is not structural
1514 | using node = sql::operation<"NOT", Row, ranode>;
| ^
../single-header/sql.hpp:149:15: note: ‘cexpr::string<char, 4>::size_’ is not public
149 | std::size_t size_;
| ^~~~~
../single-header/sql.hpp:1514:23: error: ‘<expression error>’ in namespace ‘sql’ does not name a type
1514 | using node = sql::operation<"NOT", Row, ranode>;
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../single-header/sql.hpp:1516:30: error: ‘node’ was not declared in this scope; did you mean ‘ranode’?
1516 | return context<next.pos, node>{};
| ^~~~
| ranode
../single-header/sql.hpp:1516:34: error: template argument 2 is invalid
1516 | return context<next.pos, node>{};
| ^
../single-header/sql.hpp: In static member function ‘static constexpr auto sql::query<Str, Schemas>::recurse_and()’:
../single-header/sql.hpp:1537:72: error: ‘cexpr::string<char, 4>’ is not a valid type for a template non-type parameter because it is not structural
1537 | using node = sql::operation<"AND", Row, typename Left::node, ranode>;
| ^
../single-header/sql.hpp:149:15: note: ‘cexpr::string<char, 4>::size_’ is not public
149 | std::size_t size_;
| ^~~~~
../single-header/sql.hpp:1537:23: error: ‘<expression error>’ in namespace ‘sql’ does not name a type
1537 | using node = sql::operation<"AND", Row, typename Left::node, ranode>;
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../single-header/sql.hpp:1539:42: error: ‘node’ was not declared in this scope; did you mean ‘ranode’?
1539 | return recurse_and<context<next.pos, node>, Row>();
| ^~~~
| ranode
../single-header/sql.hpp:1539:46: error: template argument 2 is invalid
1539 | return recurse_and<context<next.pos, node>, Row>();
| ^
../single-header/sql.hpp: In static member function ‘static constexpr auto sql::query<Str, Schemas>::recurse_or()’:
../single-header/sql.hpp:1565:71: error: ‘cexpr::string<char, 3>’ is not a valid type for a template non-type parameter because it is not structural
1565 | using node = sql::operation<"OR", Row, typename Left::node, ranode>;
| ^
../single-header/sql.hpp:149:15: note: ‘cexpr::string<char, 3>::size_’ is not public
149 | std::size_t size_;
| ^~~~~
../single-header/sql.hpp:1565:23: error: ‘<expression error>’ in namespace ‘sql’ does not name a type
1565 | using node = sql::operation<"OR", Row, typename Left::node, ranode>;
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../single-header/sql.hpp:1567:41: error: ‘node’ was not declared in this scope; did you mean ‘ranode’?
1567 | return recurse_or<context<next.pos, node>, Row>();
| ^~~~
| ranode
../single-header/sql.hpp:1567:45: error: template argument 2 is invalid
1567 | return recurse_or<context<next.pos, node>, Row>();
| ^
In file included from test.cpp:3:
data.hpp: At global scope:
data.hpp:14:35: error: ‘cexpr::string<char, 6>’ is not a valid type for a template non-type parameter because it is not structural
14 | sql::column<"title", std::string>,
| ^
In file included from data.hpp:6,
from test.cpp:3:
../single-header/sql.hpp:149:15: note: ‘cexpr::string<char, 6>::size_’ is not public
149 | std::size_t size_;
| ^~~~~
In file included from test.cpp:3:
data.hpp:16:35: error: ‘cexpr::string<char, 6>’ is not a valid type for a template non-type parameter because it is not structural
16 | sql::column<"genre", std::string>,
| ^
In file included from data.hpp:6,
from test.cpp:3:
../single-header/sql.hpp:149:15: note: ‘cexpr::string<char, 6>::size_’ is not public
149 | std::size_t size_;
| ^~~~~
In file included from test.cpp:3:
data.hpp:17:31: error: ‘cexpr::string<char, 5>’ is not a valid type for a template non-type parameter because it is not structural
17 | sql::column<"year", unsigned>,
| ^
In file included from data.hpp:6,
from test.cpp:3:
../single-header/sql.hpp:149:15: note: ‘cexpr::string<char, 5>::size_’ is not public
149 | std::size_t size_;
| ^~~~~
In file included from test.cpp:3:
data.hpp:18:32: error: ‘cexpr::string<char, 6>’ is not a valid type for a template non-type parameter because it is not structural
18 | sql::column<"pages", unsigned>
| ^
In file included from data.hpp:6,
from test.cpp:3:
../single-header/sql.hpp:149:15: note: ‘cexpr::string<char, 6>::size_’ is not public
149 | std::size_t size_;
| ^~~~~
In file included from test.cpp:3:
data.hpp:19:2: error: ‘cexpr::string<char, 6>’ is not a valid type for a template non-type parameter because it is not structural
19 | >;
| ^
In file included from data.hpp:6,
from test.cpp:3:
../single-header/sql.hpp:149:15: note: ‘cexpr::string<char, 6>::size_’ is not public
149 | std::size_t size_;
| ^~~~~
In file included from test.cpp:3:
data.hpp:19:2: error: template argument 3 is invalid
19 | >;
| ^
data.hpp:19:2: error: template argument 4 is invalid
data.hpp:19:2: error: template argument 5 is invalid
data.hpp:19:2: error: template argument 6 is invalid
data.hpp:9:7: error: ‘<expression error>’ in namespace ‘sql’ does not name a type
9 | sql::schema<
| ^~~~~~~
10 | "books", sql::index<>,
| ~~~~~~~~~~~~~~~~~~~~~~
11 | #ifdef CROSS
| ~~~~~~~~~~~~
12 | sql::column<"book", std::string>,
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
13 | #else
| ~~~~~
14 | sql::column<"title", std::string>,
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
15 | #endif
| ~~~~~~
16 | sql::column<"genre", std::string>,
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
17 | sql::column<"year", unsigned>,
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
18 | sql::column<"pages", unsigned>
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
19 | >;
| ~
data.hpp:27:35: error: ‘cexpr::string<char, 6>’ is not a valid type for a template non-type parameter because it is not structural
27 | sql::column<"title", std::string>,
| ^
In file included from data.hpp:6,
from test.cpp:3:
../single-header/sql.hpp:149:15: note: ‘cexpr::string<char, 6>::size_’ is not public
149 | std::size_t size_;
| ^~~~~
In file included from test.cpp:3:
data.hpp:29:35: error: ‘cexpr::string<char, 6>’ is not a valid type for a template non-type parameter because it is not structural
29 | sql::column<"genre", std::string>,
| ^
In file included from data.hpp:6,
from test.cpp:3:
../single-header/sql.hpp:149:15: note: ‘cexpr::string<char, 6>::size_’ is not public
149 | std::size_t size_;
| ^~~~~
In file included from test.cpp:3:
data.hpp:30:31: error: ‘cexpr::string<char, 5>’ is not a valid type for a template non-type parameter because it is not structural
30 | sql::column<"year", unsigned>
| ^
In file included from data.hpp:6,
from test.cpp:3:
../single-header/sql.hpp:149:15: note: ‘cexpr::string<char, 5>::size_’ is not public
149 | std::size_t size_;
| ^~~~~
In file included from test.cpp:3:
data.hpp:31:2: error: ‘cexpr::string<char, 8>’ is not a valid type for a template non-type parameter because it is not structural
31 | >;
| ^
In file included from data.hpp:6,
from test.cpp:3:
../single-header/sql.hpp:149:15: note: ‘cexpr::string<char, 8>::size_’ is not public
149 | std::size_t size_;
| ^~~~~
In file included from test.cpp:3:
data.hpp:31:2: error: template argument 3 is invalid
31 | >;
| ^
data.hpp:31:2: error: template argument 4 is invalid
data.hpp:31:2: error: template argument 5 is invalid
data.hpp:22:7: error: ‘<expression error>’ in namespace ‘sql’ does not name a type
22 | sql::schema<
| ^~~~~~~
23 | "stories", sql::index<>,
| ~~~~~~~~~~~~~~~~~~~~~~~~
24 | #ifdef CROSS
| ~~~~~~~~~~~~
25 | sql::column<"story", std::string>,
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
26 | #else
| ~~~~~
27 | sql::column<"title", std::string>,
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
28 | #endif
| ~~~~~~
29 | sql::column<"genre", std::string>,
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
30 | sql::column<"year", unsigned>
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
31 | >;
| ~
data.hpp:36:35: error: ‘cexpr::string<char, 6>’ is not a valid type for a template non-type parameter because it is not structural
36 | sql::column<"title", std::string>,
| ^
In file included from data.hpp:6,
from test.cpp:3:
../single-header/sql.hpp:149:15: note: ‘cexpr::string<char, 6>::size_’ is not public
149 | std::size_t size_;
| ^~~~~
In file included from test.cpp:3:
data.hpp:37:34: error: ‘cexpr::string<char, 5>’ is not a valid type for a template non-type parameter because it is not structural
37 | sql::column<"name", std::string>
| ^
In file included from data.hpp:6,
from test.cpp:3:
../single-header/sql.hpp:149:15: note: ‘cexpr::string<char, 5>::size_’ is not public
149 | std::size_t size_;
| ^~~~~
In file included from test.cpp:3:
data.hpp:38:2: error: ‘cexpr::string<char, 9>’ is not a valid type for a template non-type parameter because it is not structural
38 | >;
| ^
In file included from data.hpp:6,
from test.cpp:3:
../single-header/sql.hpp:149:15: note: ‘cexpr::string<char, 9>::size_’ is not public
149 | std::size_t size_;
| ^~~~~
In file included from test.cpp:3:
data.hpp:38:2: error: template argument 3 is invalid
38 | >;
| ^
data.hpp:38:2: error: template argument 4 is invalid
data.hpp:34:7: error: ‘<expression error>’ in namespace ‘sql’ does not name a type
34 | sql::schema<
| ^~~~~~~
35 | "authored", sql::index<>,
| ~~~~~~~~~~~~~~~~~~~~~~~~~
36 | sql::column<"title", std::string>,
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
37 | sql::column<"name", std::string>
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
38 | >;
| ~
data.hpp:43:35: error: ‘cexpr::string<char, 6>’ is not a valid type for a template non-type parameter because it is not structural
43 | sql::column<"title", std::string>,
| ^
In file included from data.hpp:6,
from test.cpp:3:
../single-header/sql.hpp:149:15: note: ‘cexpr::string<char, 6>::size_’ is not public
149 | std::size_t size_;
| ^~~~~
In file included from test.cpp:3:
data.hpp:44:40: error: ‘cexpr::string<char, 11>’ is not a valid type for a template non-type parameter because it is not structural
44 | sql::column<"collection", std::string>,
| ^
In file included from data.hpp:6,
from test.cpp:3:
../single-header/sql.hpp:149:15: note: ‘cexpr::string<char, 11>::size_’ is not public
149 | std::size_t size_;
| ^~~~~
In file included from test.cpp:3:
data.hpp:45:32: error: ‘cexpr::string<char, 6>’ is not a valid type for a template non-type parameter because it is not structural
45 | sql::column<"pages", unsigned>
| ^
In file included from data.hpp:6,
from test.cpp:3:
../single-header/sql.hpp:149:15: note: ‘cexpr::string<char, 6>::size_’ is not public
149 | std::size_t size_;
| ^~~~~
In file included from test.cpp:3:
data.hpp:46:2: error: ‘cexpr::string<char, 10>’ is not a valid type for a template non-type parameter because it is not structural
46 | >;
| ^
In file included from data.hpp:6,
from test.cpp:3:
../single-header/sql.hpp:149:15: note: ‘cexpr::string<char, 10>::size_’ is not public
149 | std::size_t size_;
| ^~~~~
In file included from test.cpp:3:
data.hpp:46:2: error: template argument 3 is invalid
46 | >;
| ^
data.hpp:46:2: error: template argument 4 is invalid
data.hpp:46:2: error: template argument 5 is invalid
data.hpp:41:7: error: ‘<expression error>’ in namespace ‘sql’ does not name a type
41 | sql::schema<
| ^~~~~~~
42 | "collected", sql::index<>,
| ~~~~~~~~~~~~~~~~~~~~~~~~~~
43 | sql::column<"title", std::string>,
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
44 | sql::column<"collection", std::string>,
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
45 | sql::column<"pages", unsigned>
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
46 | >;
| ~
test.cpp:8:3: error: ‘books’ was not declared in this scope
8 | books
| ^~~~~
test.cpp:9:2: error: ‘cexpr::string<char, 24>’ is not a valid type for a template non-type parameter because it is not structural
9 | >;
| ^
In file included from data.hpp:6,
from test.cpp:3:
../single-header/sql.hpp:149:15: note: ‘cexpr::string<char, 24>::size_’ is not public
149 | std::size_t size_;
| ^~~~~
test.cpp:9:2: error: template argument 2 is invalid
9 | >;
| ^
test.cpp:6:7: error: ‘<expression error>’ in namespace ‘sql’ does not name a type
6 | sql::query<
| ^~~~~~
7 | "select title from books",
| ~~~~~~~~~~~~~~~~~~~~~~~~~~
8 | books
| ~~~~~
9 | >;
| ~
test.cpp: In function ‘int main()’:
test.cpp:13:2: error: ‘books’ was not declared in this scope
13 | books t0{ sql::load<books>(data_folder + books_data, '\t') };
| ^~~~~
test.cpp:15:7: error: ‘query’ was not declared in this scope; did you mean ‘sql::query’?
15 | for (query q{ t0 }; auto const& [c0] : q)
| ^~~~~
| sql::query
In file included from data.hpp:6,
from test.cpp:3:
../single-header/sql.hpp:1429:8: note: ‘sql::query’ declared here
1429 | class query
| ^~~~~
test.cpp:15:34: error: expected unqualified-id before ‘[’ token
15 | for (query q{ t0 }; auto const& [c0] : q)
| ^
test.cpp:15:42: error: expected ‘;’ before ‘)’ token
15 | for (query q{ t0 }; auto const& [c0] : q)
| ^
| ;
test.cpp:17:16: error: ‘c0’ was not declared in this scope
17 | std::cout << c0 << '\n';
| ^~
sh: ./test: No such file or directory
Traceback (most recent call last):
File "/usr/lib/python3.8/subprocess.py", line 64, in <module>
import msvcrt
ModuleNotFoundError: No module named 'msvcrt'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "scripts/runner.py", line 40, in <module>
main()
File "scripts/runner.py", line 25, in main
stream = os.popen("diff cpp-results.txt sql-results.txt")
File "/usr/lib/python3.8/os.py", line 981, in popen
import subprocess, io
File "/usr/lib/python3.8/subprocess.py", line 71, in <module>
import selectors
File "/usr/lib/python3.8/selectors.py", line 290, in <module>
class SelectSelector(_BaseSelectorImpl):
File "/usr/lib/python3.8/selectors.py", line 317, in SelectSelector
_select = select.select
AttributeError: module 'select' has no attribute 'select'
Haven't been able to maintain this due to work. You're probably right about the operator<=>
causing issues. I probably can still approve PRs, hard to say. If you have a fix, I might be able to merge it.
Might look into a solution this weekend.
I am willing to PR when I have time. Missing of operator<=> can be confirmed via a GCC testcase, and all private data members may need to be public.