Advertisement
KShah

Untitled

Nov 11th, 2021
67
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. stdout:
  2. TMP=$(pwd) g++-8 -std=c++17 -O0 -Wall -Wextra -Werror -o ./solution *.cpp
  3. makefile:3: recipe for target 'build' failed
  4.  
  5.  
  6. stderr:
  7. source.cpp: In member function ‘bool String::operator==(const String&)’:
  8. source.cpp:75:31: error: comparison of integer expressions of different signedness: ‘int’ and ‘size_t’ {aka ‘long unsigned int’} [-Werror=sign-compare]
  9. for (int i = 0; i < this->sz; ++i) {
  10. ~~^~~~~~~~~~
  11. cc1plus: all warnings being treated as errors
  12. string_test.cpp: In function ‘void test1()’:
  13. string_test.cpp:12:5: error: ‘String’ was not declared in this scope
  14. String s("abcdef");
  15. ^~~~~~
  16. string_test.cpp:12:5: note: suggested alternative: ‘stdin’
  17. String s("abcdef");
  18. ^~~~~~
  19. stdin
  20. In file included from /usr/include/c++/8/cassert:44,
  21. from string_test.cpp:3:
  22. string_test.cpp:13:12: error: ‘s’ was not declared in this scope
  23. assert(s.length() == 6);
  24. ^
  25. string_test.cpp: In function ‘void test2()’:
  26. string_test.cpp:29:11: error: ‘String’ does not name a type; did you mean ‘stdin’?
  27. const String s("abcdef");
  28. ^~~~~~
  29. stdin
  30. In file included from /usr/include/c++/8/cassert:44,
  31. from string_test.cpp:3:
  32. string_test.cpp:30:12: error: ‘s’ was not declared in this scope
  33. assert(s.length() == 6);
  34. ^
  35. string_test.cpp:36:62: error: ISO C++ forbids declaration of ‘type name’ with no type [-fpermissive]
  36. assert((!std::is_assignable_v<decltype(static_cast<const String&>(String())[0]), char>));
  37. ^~~~~~
  38. string_test.cpp:36:62: error: ‘String’ was not declared in this scope
  39. string_test.cpp:36:62: note: suggested alternative: ‘stdin’
  40. string_test.cpp:36:62: error: ISO C++ forbids declaration of ‘type name’ with no type [-fpermissive]
  41. string_test.cpp:36:62: error: expected ‘>’ before ‘String’
  42. string_test.cpp:36:62: error: expected ‘(’ before ‘String’
  43. string_test.cpp:36:69: error: expected primary-expression before ‘>’ token
  44. assert((!std::is_assignable_v<decltype(static_cast<const String&>(String())[0]), char>));
  45. ^
  46. string_test.cpp:36:86: error: expected primary-expression before ‘char’
  47. assert((!std::is_assignable_v<decltype(static_cast<const String&>(String())[0]), char>));
  48. ^~~~
  49. string_test.cpp:36:62: error: ISO C++ forbids declaration of ‘type name’ with no type [-fpermissive]
  50. assert((!std::is_assignable_v<decltype(static_cast<const String&>(String())[0]), char>));
  51. ^~~~~~
  52. string_test.cpp:36:62: error: ISO C++ forbids declaration of ‘type name’ with no type [-fpermissive]
  53. string_test.cpp:36:62: error: expected ‘>’ before ‘String’
  54. string_test.cpp:36:62: error: expected ‘(’ before ‘String’
  55. string_test.cpp:36:69: error: expected primary-expression before ‘>’ token
  56. assert((!std::is_assignable_v<decltype(static_cast<const String&>(String())[0]), char>));
  57. ^
  58. string_test.cpp:36:86: error: expected primary-expression before ‘char’
  59. assert((!std::is_assignable_v<decltype(static_cast<const String&>(String())[0]), char>));
  60. ^~~~
  61. string_test.cpp:36:62: error: ISO C++ forbids declaration of ‘type name’ with no type [-fpermissive]
  62. assert((!std::is_assignable_v<decltype(static_cast<const String&>(String())[0]), char>));
  63. ^~~~~~
  64. string_test.cpp:36:62: error: ISO C++ forbids declaration of ‘type name’ with no type [-fpermissive]
  65. string_test.cpp:36:62: error: expected ‘>’ before ‘String’
  66. string_test.cpp:36:62: error: expected ‘(’ before ‘String’
  67. string_test.cpp:36:69: error: expected primary-expression before ‘>’ token
  68. assert((!std::is_assignable_v<decltype(static_cast<const String&>(String())[0]), char>));
  69. ^
  70. string_test.cpp:36:86: error: expected primary-expression before ‘char’
  71. assert((!std::is_assignable_v<decltype(static_cast<const String&>(String())[0]), char>));
  72. ^~~~
  73. string_test.cpp:36:62: error: ISO C++ forbids declaration of ‘type name’ with no type [-fpermissive]
  74. assert((!std::is_assignable_v<decltype(static_cast<const String&>(String())[0]), char>));
  75. ^~~~~~
  76. string_test.cpp:36:62: error: ISO C++ forbids declaration of ‘type name’ with no type [-fpermissive]
  77. string_test.cpp:36:62: error: expected ‘>’ before ‘String’
  78. string_test.cpp:36:62: error: expected ‘(’ before ‘String’
  79. string_test.cpp:36:69: error: expected primary-expression before ‘>’ token
  80. assert((!std::is_assignable_v<decltype(static_cast<const String&>(String())[0]), char>));
  81. ^
  82. string_test.cpp:36:86: error: expected primary-expression before ‘char’
  83. assert((!std::is_assignable_v<decltype(static_cast<const String&>(String())[0]), char>));
  84. ^~~~
  85. string_test.cpp:36:62: error: ISO C++ forbids declaration of ‘type name’ with no type [-fpermissive]
  86. assert((!std::is_assignable_v<decltype(static_cast<const String&>(String())[0]), char>));
  87. ^~~~~~
  88. string_test.cpp:36:62: error: ISO C++ forbids declaration of ‘type name’ with no type [-fpermissive]
  89. string_test.cpp:36:62: error: expected ‘>’ before ‘String’
  90. string_test.cpp:36:62: error: expected ‘(’ before ‘String’
  91. string_test.cpp:36:69: error: expected primary-expression before ‘>’ token
  92. assert((!std::is_assignable_v<decltype(static_cast<const String&>(String())[0]), char>));
  93. ^
  94. string_test.cpp:36:86: error: expected primary-expression before ‘char’
  95. assert((!std::is_assignable_v<decltype(static_cast<const String&>(String())[0]), char>));
  96. ^~~~
  97. string_test.cpp:36:62: error: ISO C++ forbids declaration of ‘type name’ with no type [-fpermissive]
  98. assert((!std::is_assignable_v<decltype(static_cast<const String&>(String())[0]), char>));
  99. ^~~~~~
  100. string_test.cpp:36:62: error: ISO C++ forbids declaration of ‘type name’ with no type [-fpermissive]
  101. string_test.cpp:36:62: error: expected ‘>’ before ‘String’
  102. string_test.cpp:36:62: error: expected ‘(’ before ‘String’
  103. string_test.cpp:36:69: error: expected primary-expression before ‘>’ token
  104. assert((!std::is_assignable_v<decltype(static_cast<const String&>(String())[0]), char>));
  105. ^
  106. string_test.cpp:36:86: error: expected primary-expression before ‘char’
  107. assert((!std::is_assignable_v<decltype(static_cast<const String&>(String())[0]), char>));
  108. ^~~~
  109. string_test.cpp:36:62: error: ISO C++ forbids declaration of ‘type name’ with no type [-fpermissive]
  110. assert((!std::is_assignable_v<decltype(static_cast<const String&>(String())[0]), char>));
  111. ^~~~~~
  112. string_test.cpp:36:62: error: ISO C++ forbids declaration of ‘type name’ with no type [-fpermissive]
  113. string_test.cpp:36:62: error: expected ‘>’ before ‘String’
  114. string_test.cpp:36:62: error: expected ‘(’ before ‘String’
  115. string_test.cpp:36:69: error: expected primary-expression before ‘>’ token
  116. assert((!std::is_assignable_v<decltype(static_cast<const String&>(String())[0]), char>));
  117. ^
  118. string_test.cpp:36:86: error: expected primary-expression before ‘char’
  119. assert((!std::is_assignable_v<decltype(static_cast<const String&>(String())[0]), char>));
  120. ^~~~
  121. string_test.cpp:36:19: error: parse error in template argument list
  122. assert((!std::is_assignable_v<decltype(static_cast<const String&>(String())[0]), char>));
  123. ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  124. string_test.cpp:36:19: error: wrong number of template arguments (1, should be 2)
  125. In file included from /usr/include/c++/8/bits/move.h:55,
  126. from /usr/include/c++/8/bits/stl_pair.h:59,
  127. from /usr/include/c++/8/bits/stl_algobase.h:64,
  128. from /usr/include/c++/8/bits/char_traits.h:39,
  129. from /usr/include/c++/8/string:40,
  130. from string_test.cpp:4:
  131. /usr/include/c++/8/type_traits:2817:25: note: provided for ‘template<class _Tp, class _Up> constexpr const bool std::is_assignable_v<_Tp, _Up>’
  132. inline constexpr bool is_assignable_v = is_assignable<_Tp, _Up>::value;
  133. ^~~~~~~~~~~~~~~
  134. In file included from /usr/include/c++/8/cassert:44,
  135. from string_test.cpp:3:
  136. string_test.cpp:37:62: error: ISO C++ forbids declaration of ‘type name’ with no type [-fpermissive]
  137. assert((!std::is_assignable_v<decltype(static_cast<const String&>(String()).front()), char>));
  138. ^~~~~~
  139. string_test.cpp:37:62: error: ISO C++ forbids declaration of ‘type name’ with no type [-fpermissive]
  140. string_test.cpp:37:62: error: expected ‘>’ before ‘String’
  141. string_test.cpp:37:62: error: expected ‘(’ before ‘String’
  142. string_test.cpp:37:69: error: expected primary-expression before ‘>’ token
  143. assert((!std::is_assignable_v<decltype(static_cast<const String&>(String()).front()), char>));
  144. ^
  145. string_test.cpp:37:91: error: expected primary-expression before ‘char’
  146. assert((!std::is_assignable_v<decltype(static_cast<const String&>(String()).front()), char>));
  147. ^~~~
  148. string_test.cpp:37:62: error: ISO C++ forbids declaration of ‘type name’ with no type [-fpermissive]
  149. assert((!std::is_assignable_v<decltype(static_cast<const String&>(String()).front()), char>));
  150. ^~~~~~
  151. string_test.cpp:37:62: error: ISO C++ forbids declaration of ‘type name’ with no type [-fpermissive]
  152. string_test.cpp:37:62: error: expected ‘>’ before ‘String’
  153. string_test.cpp:37:62: error: expected ‘(’ before ‘String’
  154. string_test.cpp:37:69: error: expected primary-expression before ‘>’ token
  155. assert((!std::is_assignable_v<decltype(static_cast<const String&>(String()).front()), char>));
  156. ^
  157. string_test.cpp:37:91: error: expected primary-expression before ‘char’
  158. assert((!std::is_assignable_v<decltype(static_cast<const String&>(String()).front()), char>));
  159. ^~~~
  160. string_test.cpp:37:62: error: ISO C++ forbids declaration of ‘type name’ with no type [-fpermissive]
  161. assert((!std::is_assignable_v<decltype(static_cast<const String&>(String()).front()), char>));
  162. ^~~~~~
  163. string_test.cpp:37:62: error: ISO C++ forbids declaration of ‘type name’ with no type [-fpermissive]
  164. string_test.cpp:37:62: error: expected ‘>’ before ‘String’
  165. string_test.cpp:37:62: error: expected ‘(’ before ‘String’
  166. string_test.cpp:37:69: error: expected primary-expression before ‘>’ token
  167. assert((!std::is_assignable_v<decltype(static_cast<const String&>(String()).front()), char>));
  168. ^
  169. string_test.cpp:37:91: error: expected primary-expression before ‘char’
  170. assert((!std::is_assignable_v<decltype(static_cast<const String&>(String()).front()), char>));
  171. ^~~~
  172. string_test.cpp:37:62: error: ISO C++ forbids declaration of ‘type name’ with no type [-fpermissive]
  173. assert((!std::is_assignable_v<decltype(static_cast<const String&>(String()).front()), char>));
  174. ^~~~~~
  175. string_test.cpp:37:62: error: ISO C++ forbids declaration of ‘type name’ with no type [-fpermissive]
  176. string_test.cpp:37:62: error: expected ‘>’ before ‘String’
  177. string_test.cpp:37:62: error: expected ‘(’ before ‘String’
  178. string_test.cpp:37:69: error: expected primary-expression before ‘>’ token
  179. assert((!std::is_assignable_v<decltype(static_cast<const String&>(String()).front()), char>));
  180. ^
  181. string_test.cpp:37:91: error: expected primary-expression before ‘char’
  182. assert((!std::is_assignable_v<decltype(static_cast<const String&>(String()).front()), char>));
  183. ^~~~
  184. string_test.cpp:37:62: error: ISO C++ forbids declaration of ‘type name’ with no type [-fpermissive]
  185. assert((!std::is_assignable_v<decltype(static_cast<const String&>(String()).front()), char>));
  186. ^~~~~~
  187. string_test.cpp:37:62: error: ISO C++ forbids declaration of ‘type name’ with no type [-fpermissive]
  188. string_test.cpp:37:62: error: expected ‘>’ before ‘String’
  189. string_test.cpp:37:62: error: expected ‘(’ before ‘String’
  190. string_test.cpp:37:69: error: expected primary-expression before ‘>’ token
  191. assert((!std::is_assignable_v<decltype(static_cast<const String&>(String()).front()), char>));
  192. ^
  193. string_test.cpp:37:91: error: expected primary-expression before ‘char’
  194. assert((!std::is_assignable_v<decltype(static_cast<const String&>(String()).front()), char>));
  195. ^~~~
  196. string_test.cpp:37:62: error: ISO C++ forbids declaration of ‘type name’ with no type [-fpermissive]
  197. assert((!std::is_assignable_v<decltype(static_cast<const String&>(String()).front()), char>));
  198. ^~~~~~
  199. string_test.cpp:37:62: error: ISO C++ forbids declaration of ‘type name’ with no type [-fpermissive]
  200. string_test.cpp:37:62: error: expected ‘>’ before ‘String’
  201. string_test.cpp:37:62: error: expected ‘(’ before ‘String’
  202. string_test.cpp:37:69: error: expected primary-expression before ‘>’ token
  203. assert((!std::is_assignable_v<decltype(static_cast<const String&>(String()).front()), char>));
  204. ^
  205. string_test.cpp:37:91: error: expected primary-expression before ‘char’
  206. assert((!std::is_assignable_v<decltype(static_cast<const String&>(String()).front()), char>));
  207. ^~~~
  208. string_test.cpp:37:62: error: ISO C++ forbids declaration of ‘type name’ with no type [-fpermissive]
  209. assert((!std::is_assignable_v<decltype(static_cast<const String&>(String()).front()), char>));
  210. ^~~~~~
  211. string_test.cpp:37:62: error: ISO C++ forbids declaration of ‘type name’ with no type [-fpermissive]
  212. string_test.cpp:37:62: error: expected ‘>’ before ‘String’
  213. string_test.cpp:37:62: error: expected ‘(’ before ‘String’
  214. string_test.cpp:37:69: error: expected primary-expression before ‘>’ token
  215. assert((!std::is_assignable_v<decltype(static_cast<const String&>(String()).front()), char>));
  216. ^
  217. string_test.cpp:37:91: error: expected primary-expression before ‘char’
  218. assert((!std::is_assignable_v<decltype(static_cast<const String&>(String()).front()), char>));
  219. ^~~~
  220. string_test.cpp:37:19: error: parse error in template argument list
  221. assert((!std::is_assignable_v<decltype(static_cast<const String&>(String()).front()), char>));
  222. ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  223. string_test.cpp:37:19: error: wrong number of template arguments (1, should be 2)
  224. In file included from /usr/include/c++/8/bits/move.h:55,
  225. from /usr/include/c++/8/bits/stl_pair.h:59,
  226. from /usr/include/c++/8/bits/stl_algobase.h:64,
  227. from /usr/include/c++/8/bits/char_traits.h:39,
  228. from /usr/include/c++/8/string:40,
  229. from string_test.cpp:4:
  230. /usr/include/c++/8/type_traits:2817:25: note: provided for ‘template<class _Tp, class _Up> constexpr const bool std::is_assignable_v<_Tp, _Up>’
  231. inline constexpr bool is_assignable_v = is_assignable<_Tp, _Up>::value;
  232. ^~~~~~~~~~~~~~~
  233. In file included from /usr/include/c++/8/cassert:44,
  234. from string_test.cpp:3:
  235. string_test.cpp:38:62: error: ISO C++ forbids declaration of ‘type name’ with no type [-fpermissive]
  236. assert((!std::is_assignable_v<decltype(static_cast<const String&>(String()).back()), char>));
  237. ^~~~~~
  238. string_test.cpp:38:62: error: ISO C++ forbids declaration of ‘type name’ with no type [-fpermissive]
  239. string_test.cpp:38:62: error: expected ‘>’ before ‘String’
  240. string_test.cpp:38:62: error: expected ‘(’ before ‘String’
  241. string_test.cpp:38:69: error: expected primary-expression before ‘>’ token
  242. assert((!std::is_assignable_v<decltype(static_cast<const String&>(String()).back()), char>));
  243. ^
  244. string_test.cpp:38:90: error: expected primary-expression before ‘char’
  245. assert((!std::is_assignable_v<decltype(static_cast<const String&>(String()).back()), char>));
  246. ^~~~
  247. string_test.cpp:38:62: error: ISO C++ forbids declaration of ‘type name’ with no type [-fpermissive]
  248. assert((!std::is_assignable_v<decltype(static_cast<const String&>(String()).back()), char>));
  249. ^~~~~~
  250. string_test.cpp:38:62: error: ISO C++ forbids declaration of ‘type name’ with no type [-fpermissive]
  251. string_test.cpp:38:62: error: expected ‘>’ before ‘String’
  252. string_test.cpp:38:62: error: expected ‘(’ before ‘String’
  253. string_test.cpp:38:69: error: expected primary-expression before ‘>’ token
  254. assert((!std::is_assignable_v<decltype(static_cast<const String&>(String()).back()), char>));
  255. ^
  256. string_test.cpp:38:90: error: expected primary-expression before ‘char’
  257. assert((!std::is_assignable_v<decltype(static_cast<const String&>(String()).back()), char>));
  258. ^~~~
  259. string_test.cpp:38:62: error: ISO C++ forbids declaration of ‘type name’ with no type [-fpermissive]
  260. assert((!std::is_assignable_v<decltype(static_cast<const String&>(String()).back()), char>));
  261. ^~~~~~
  262. string_test.cpp:38:62: error: ISO C++ forbids declaration of ‘type name’ with no type [-fpermissive]
  263. string_test.cpp:38:62: error: expected ‘>’ before ‘String’
  264. string_test.cpp:38:62: error: expected ‘(’ before ‘String’
  265. string_test.cpp:38:69: error: expected primary-expression before ‘>’ token
  266. assert((!std::is_assignable_v<decltype(static_cast<const String&>(String()).back()), char>));
  267. ^
  268. string_test.cpp:38:90: error: expected primary-expression before ‘char’
  269. assert((!std::is_assignable_v<decltype(static_cast<const String&>(String()).back()), char>));
  270. ^~~~
  271. string_test.cpp:38:62: error: ISO C++ forbids declaration of ‘type name’ with no type [-fpermissive]
  272. assert((!std::is_assignable_v<decltype(static_cast<const String&>(String()).back()), char>));
  273. ^~~~~~
  274. string_test.cpp:38:62: error: ISO C++ forbids declaration of ‘type name’ with no type [-fpermissive]
  275. string_test.cpp:38:62: error: expected ‘>’ before ‘String’
  276. string_test.cpp:38:62: error: expected ‘(’ before ‘String’
  277. string_test.cpp:38:69: error: expected primary-expression before ‘>’ token
  278. assert((!std::is_assignable_v<decltype(static_cast<const String&>(String()).back()), char>));
  279. ^
  280. string_test.cpp:38:90: error: expected primary-expression before ‘char’
  281. assert((!std::is_assignable_v<decltype(static_cast<const String&>(String()).back()), char>));
  282. ^~~~
  283. string_test.cpp:38:62: error: ISO C++ forbids declaration of ‘type name’ with no type [-fpermissive]
  284. assert((!std::is_assignable_v<decltype(static_cast<const String&>(String()).back()), char>));
  285. ^~~~~~
  286. string_test.cpp:38:62: error: ISO C++ forbids declaration of ‘type name’ with no type [-fpermissive]
  287. string_test.cpp:38:62: error: expected ‘>’ before ‘String’
  288. string_test.cpp:38:62: error: expected ‘(’ before ‘String’
  289. string_test.cpp:38:69: error: expected primary-expression before ‘>’ token
  290. assert((!std::is_assignable_v<decltype(static_cast<const String&>(String()).back()), char>));
  291. ^
  292. string_test.cpp:38:90: error: expected primary-expression before ‘char’
  293. assert((!std::is_assignable_v<decltype(static_cast<const String&>(String()).back()), char>));
  294. ^~~~
  295. string_test.cpp:38:62: error: ISO C++ forbids declaration of ‘type name’ with no type [-fpermissive]
  296. assert((!std::is_assignable_v<decltype(static_cast<const String&>(String()).back()), char>));
  297. ^~~~~~
  298. string_test.cpp:38:62: error: ISO C++ forbids declaration of ‘type name’ with no type [-fpermissive]
  299. string_test.cpp:38:62: error: expected ‘>’ before ‘String’
  300. string_test.cpp:38:62: error: expected ‘(’ before ‘String’
  301. string_test.cpp:38:69: error: expected primary-expression before ‘>’ token
  302. assert((!std::is_assignable_v<decltype(static_cast<const String&>(String()).back()), char>));
  303. ^
  304. string_test.cpp:38:90: error: expected primary-expression before ‘char’
  305. assert((!std::is_assignable_v<decltype(static_cast<const String&>(String()).back()), char>));
  306. ^~~~
  307. string_test.cpp:38:62: error: ISO C++ forbids declaration of ‘type name’ with no type [-fpermissive]
  308. assert((!std::is_assignable_v<decltype(static_cast<const String&>(String()).back()), char>));
  309. ^~~~~~
  310. string_test.cpp:38:62: error: ISO C++ forbids declaration of ‘type name’ with no type [-fpermissive]
  311. string_test.cpp:38:62: error: expected ‘>’ before ‘String’
  312. string_test.cpp:38:62: error: expected ‘(’ before ‘String’
  313. string_test.cpp:38:69: error: expected primary-expression before ‘>’ token
  314. assert((!std::is_assignable_v<decltype(static_cast<const String&>(String()).back()), char>));
  315. ^
  316. string_test.cpp:38:90: error: expected primary-expression before ‘char’
  317. assert((!std::is_assignable_v<decltype(static_cast<const String&>(String()).back()), char>));
  318. ^~~~
  319. string_test.cpp:38:19: error: parse error in template argument list
  320. assert((!std::is_assignable_v<decltype(static_cast<const String&>(String()).back()), char>));
  321. ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  322. string_test.cpp:38:19: error: wrong number of template arguments (1, should be 2)
  323. In file included from /usr/include/c++/8/bits/move.h:55,
  324. from /usr/include/c++/8/bits/stl_pair.h:59,
  325. from /usr/include/c++/8/bits/stl_algobase.h:64,
  326. from /usr/include/c++/8/bits/char_traits.h:39,
  327. from /usr/include/c++/8/string:40,
  328. from string_test.cpp:4:
  329. /usr/include/c++/8/type_traits:2817:25: note: provided for ‘template<class _Tp, class _Up> constexpr const bool std::is_assignable_v<_Tp, _Up>’
  330. inline constexpr bool is_assignable_v = is_assignable<_Tp, _Up>::value;
  331. ^~~~~~~~~~~~~~~
  332. string_test.cpp: In function ‘void test3()’:
  333. string_test.cpp:42:5: error: ‘String’ was not declared in this scope
  334. String s("aaa");
  335. ^~~~~~
  336. string_test.cpp:42:5: note: suggested alternative: ‘stdin’
  337. String s("aaa");
  338. ^~~~~~
  339. stdin
  340. string_test.cpp:44:9: error: ‘s’ was not declared in this scope
  341. s.push_back('a');
  342. ^
  343. string_test.cpp:48:15: error: expected ‘;’ before ‘ss’
  344. String ss = s;
  345. ^~~
  346. ;
  347. In file included from /usr/include/c++/8/cassert:44,
  348. from string_test.cpp:3:
  349. string_test.cpp:49:16: error: ‘ss’ was not declared in this scope
  350. assert(ss.length() == 500'003);
  351. ^~
  352. string_test.cpp:50:16: error: ‘s’ was not declared in this scope
  353. assert(s[500'000] == 'a');
  354. ^
  355. string_test.cpp:53:12: error: ‘s’ was not declared in this scope
  356. assert(s.length() == 500'003);
  357. ^
  358. string_test.cpp:57:11: error: expected ‘;’ before ‘ss’
  359. String ss = s;
  360. ^~~
  361. ;
  362. In file included from /usr/include/c++/8/cassert:44,
  363. from string_test.cpp:3:
  364. string_test.cpp:64:12: error: ‘ss’ was not declared in this scope
  365. assert(ss.length() == 500'003);
  366. ^~
  367. string_test.cpp:72:15: error: ‘String’ does not name a type; did you mean ‘stdin’?
  368. const String sss(1000, 'a');
  369. ^~~~~~
  370. stdin
  371. string_test.cpp:73:15: error: expected ‘;’ before ‘sz’
  372. String sz = sss;
  373. ^~~
  374. ;
  375. string_test.cpp:74:14: error: ‘sz’ was not declared in this scope
  376. s += sz.back();
  377. ^~
  378. string_test.cpp: In function ‘void test4()’:
  379. string_test.cpp:101:5: error: ‘String’ was not declared in this scope
  380. String s;
  381. ^~~~~~
  382. string_test.cpp:101:5: note: suggested alternative: ‘stdin’
  383. String s;
  384. ^~~~~~
  385. stdin
  386. In file included from /usr/include/c++/8/cassert:44,
  387. from string_test.cpp:3:
  388. string_test.cpp:102:12: error: ‘s’ was not declared in this scope
  389. assert(s.empty());
  390. ^
  391. string_test.cpp:107:11: error: expected ‘;’ before ‘ss’
  392. String ss;
  393. ^~~
  394. ;
  395. string_test.cpp:108:12: error: ‘ss’ was not declared in this scope
  396. iss >> ss;
  397. ^~
  398. string_test.cpp:108:12: note: suggested alternative: ‘iss’
  399. iss >> ss;
  400. ^~
  401. iss
  402. string_test.cpp: In function ‘void test5()’:
  403. string_test.cpp:128:5: error: ‘String’ was not declared in this scope
  404. String s = "abcde";
  405. ^~~~~~
  406. string_test.cpp:128:5: note: suggested alternative: ‘stdin’
  407. String s = "abcde";
  408. ^~~~~~
  409. stdin
  410. string_test.cpp:130:16: error: ‘s’ was not declared in this scope
  411. auto& ss = s += 'f';
  412. ^
  413. string_test.cpp:130:16: note: suggested alternative: ‘ss’
  414. auto& ss = s += 'f';
  415. ^
  416. ss
  417. string_test.cpp:143:20: error: unable to deduce ‘auto’ from ‘ss’
  418. auto sss = ss;
  419. ^~
  420. string_test.cpp: In function ‘void test6()’:
  421. string_test.cpp:151:11: error: ‘String’ does not name a type; did you mean ‘stdin’?
  422. const String s = "122333444455555";
  423. ^~~~~~
  424. stdin
  425. In file included from /usr/include/c++/8/cassert:44,
  426. from string_test.cpp:3:
  427. string_test.cpp:154:12: error: ‘s’ was not declared in this scope
  428. assert(s.find("44") == 6);
  429. ^
  430. string_test.cpp:157:47: error: ‘String’ was not declared in this scope
  431. assert(s.find("12345") == (std::is_same_v<String, std::string> ? std::string::npos : s.length()));
  432. ^~~~~~
  433. string_test.cpp:157:47: note: suggested alternative: ‘stdin’
  434. string_test.cpp:157:37: error: template argument 1 is invalid
  435. assert(s.find("12345") == (std::is_same_v<String, std::string> ? std::string::npos : s.length()));
  436. ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  437. string_test.cpp:162:9: error: invalid types ‘int[int]’ for array subscript
  438. ss[0] = '0';
  439. ^
  440. string_test.cpp:166:10: error: invalid types ‘int[int]’ for array subscript
  441. sss[0] = '2';
  442. ^
  443. In file included from /usr/include/c++/8/cassert:44,
  444. from string_test.cpp:3:
  445. string_test.cpp:167:16: error: invalid types ‘int[int]’ for array subscript
  446. assert(ss[0] == '2');
  447. ^
  448. string_test.cpp:170:10: error: request for member ‘front’ in ‘ssss’, which is of non-class type ‘int’
  449. ssss.front() = '3';
  450. ^~~~~
  451. In file included from /usr/include/c++/8/cassert:44,
  452. from string_test.cpp:3:
  453. string_test.cpp:171:15: error: request for member ‘front’ in ‘ss’, which is of non-class type ‘int’
  454. assert(ss.front() == '3');
  455. ^~~~~
  456. make: *** [build] Error 1
Advertisement
Advertisement
Advertisement
RAW Paste Data Copied
Advertisement