ID 5787135
Пользователь Росляков Владимир Олегович
Время 20:48<< 16.11.2021 20:49 (27 д. 18:49) 20:50>>
Обработка 20:49 ... 20:49 (2,54 сек.)
Файл 5787135.cpp (CLang++ 5.0.0 + Address Sanitizer)
Турнир 2 курс. Программирование на C++. Турнир 2, осень 2021
Задача C: Smart Pointer
Набор тестов
Ограничения Время: 25с Память: 512Мб
Состояние  [?]
CE Ошибка компиляции
код | результаты
In file included from main.cpp:2:0:
SmartPointer.hpp: In constructor 'smart_pointer::SmartPointer<T, Allocator>::Core::Core(smart_pointer::SmartPointer<T, Allocator>::value_type*)':
SmartPointer.hpp:129:40: error: class 'smart_pointer::SmartPointer<T, Allocator>::Core' does not have any field named 'value_'
     explicit Core(value_type *value) : value_(value), count_owners_(0) {
                                        ^~~~~~
SmartPointer.hpp:129:55: error: class 'smart_pointer::SmartPointer<T, Allocator>::Core' does not have any field named 'count_owners_'
     explicit Core(value_type *value) : value_(value), count_owners_(0) {
                                                       ^~~~~~~~~~~~~
In file included from main.cpp:3:0:
Test_SmartPointer.hpp: In function 'std::enable_if_t<std::is_floating_point<_Tp>::value> __stress_tests__SmartPointer_operator_star(const string&)':
Test_SmartPointer.hpp:17:5: error: there are no arguments to 'TEST_BLOCK' that depend on a template parameter, so a declaration of 'TEST_BLOCK' must be available [-fpermissive]
     TEST_BLOCK("[stress] SmartPointer[non-nullptr]::operator*() const") {
     ^~~~~~~~~~
Test_SmartPointer.hpp:17:5: note: (if you use '-fpermissive', G++ will accept your code, but allowing the use of an undeclared name is deprecated)
Test_SmartPointer.hpp:17:73: error: expected ';' before '{' token
     TEST_BLOCK("[stress] SmartPointer[non-nullptr]::operator*() const") {
                                                                         ^
Test_SmartPointer.hpp:33:5: error: there are no arguments to 'TEST_BLOCK' that depend on a template parameter, so a declaration of 'TEST_BLOCK' must be available [-fpermissive]
     TEST_BLOCK("[stress] SmartPointer[non-nullptr]::operator*()") {
     ^~~~~~~~~~
Test_SmartPointer.hpp:33:67: error: expected ';' before '{' token
     TEST_BLOCK("[stress] SmartPointer[non-nullptr]::operator*()") {
                                                                   ^
Test_SmartPointer.hpp: In function 'std::enable_if_t<std::is_integral<_Tp>::value> __stress_tests__SmartPointer_operator_star(const string&)':
Test_SmartPointer.hpp:55:5: error: there are no arguments to 'TEST_BLOCK' that depend on a template parameter, so a declaration of 'TEST_BLOCK' must be available [-fpermissive]
     TEST_BLOCK("[stress] SmartPointer[non-nullptr]::operator*() const") {
     ^~~~~~~~~~
Test_SmartPointer.hpp:55:73: error: expected ';' before '{' token
     TEST_BLOCK("[stress] SmartPointer[non-nullptr]::operator*() const") {
                                                                         ^
In file included from main.cpp:3:0:
Test_SmartPointer.hpp:71:5: error: there are no arguments to 'TEST_BLOCK' that depend on a template parameter, so a declaration of 'TEST_BLOCK' must be available [-fpermissive]
     TEST_BLOCK("[stress] SmartPointer[non-nullptr]::operator*()") {
     ^~~~~~~~~~
Test_SmartPointer.hpp:71:67: error: expected ';' before '{' token
     TEST_BLOCK("[stress] SmartPointer[non-nullptr]::operator*()") {
                                                                   ^
Test_SmartPointer.hpp: At global scope:
Test_SmartPointer.hpp:97:40: error: ISO C++ forbids declaration of 'DEFINE_CLASS_TESTS' with no type [-fpermissive]
 DEFINE_CLASS_TESTS(SmartPointer__type_t) {
                                        ^
Test_SmartPointer.hpp: In function 'int DEFINE_CLASS_TESTS(SmartPointer__type_t)':
Test_SmartPointer.hpp:98:5: error: 'TEST_BLOCK' was not declared in this scope
     TEST_BLOCK("sizeof(SmartPointer)") {
     ^~~~~~~~~~
Test_SmartPointer.hpp:98:5: note: suggested alternative: 'EDEADLOCK'
     TEST_BLOCK("sizeof(SmartPointer)") {
     ^~~~~~~~~~
     EDEADLOCK
Test_SmartPointer.hpp:247:82: error: 'classname' was not declared in this scope
     __stress_tests__SmartPointer_operator_star<SmartPointer__type_t::value_type>(classname);
                                                                                  ^~~~~~~~~
Test_SmartPointer.hpp:247:82: note: suggested alternative: 'ptsname'
     __stress_tests__SmartPointer_operator_star<SmartPointer__type_t::value_type>(classname);
                                                                                  ^~~~~~~~~
                                                                                  ptsname
Test_SmartPointer.hpp:419:1: error: no return statement in function returning non-void [-Werror=return-type]
 }
 ^
main.cpp: In function 'int main()':
main.cpp:6:44: error: expected primary-expression before ')' token
     EXECUTE_CLASS_TEST(SmartPointer__type_t);
                                            ^
main.cpp:6:5: error: 'EXECUTE_CLASS_TEST' was not declared in this scope
     EXECUTE_CLASS_TEST(SmartPointer__type_t);
     ^~~~~~~~~~~~~~~~~~
main.cpp:6:5: note: suggested alternative: 'DEFINE_CLASS_TESTS'
     EXECUTE_CLASS_TEST(SmartPointer__type_t);
     ^~~~~~~~~~~~~~~~~~
     DEFINE_CLASS_TESTS
main.cpp:7:7: error: 'cout' is not a member of 'std'
  std::cout << 1 << std::endl;
       ^~~~
main.cpp:7:7: note: suggested alternative: 'cbrt'
  std::cout << 1 << std::endl;
       ^~~~
       cbrt
main.cpp:7:25: error: 'endl' is not a member of 'std'
  std::cout << 1 << std::endl;
                         ^~~~
main.cpp:7:25: note: suggested alternative: 'end'
  std::cout << 1 << std::endl;
                         ^~~~
                         end
cc1plus: all warnings being treated as errors
[печатать | |
]
(3 257 b)
0.038s 0.009s 10