Wandbox
SettingsLog
SettingsLog
Language
GitHubLogin
Ran/Viewed Log

Author

anonymous

about 4 years ago

Language

C++

Compiler

clang HEAD 13.0.0 (https://github.com/llvm/llvm-project.git 1b11b5b01fd8887a9c471b10cd99f0a60f6b2e50)

Options
Warnings
Boost 1.73.0
C++2b(GNU)
no pedantic

Author

anonymous

about 4 years ago

$ clang++ prog.cc -Wall -Wextra -I/opt/wandbox/boost-1.73.0/clang-head/include -std=gnu++2b
prog.cc:20:40: error: type 'int' cannot be used prior to '::' because it has no members
    return std::make_optional<typename T::value_type>(1).value();
                                       ^
prog.cc:24:36: note: in instantiation of function template specialization 'f<int>' requested here
    constexpr auto expected_zero = f<int>();
                                   ^
prog.cc:24:36: error: constexpr variable 'expected_zero' must be initialized by a constant expression
    constexpr auto expected_zero = f<int>();
                                   ^~~~~~~~
prog.cc:26:19: error: static_assert expression is not an integral constant expression
    static_assert(expected_zero == 0);
                  ^~~~~~~~~~~~~~~~~~
prog.cc:26:19: note: initializer of 'expected_zero' is not a constant expression
prog.cc:24:20: note: declared here
    constexpr auto expected_zero = f<int>();
                   ^
3 errors generated.
Exit Code:
1