Wandbox
SettingsLog
SettingsLog
Language
GitHubLogin
Ran/Viewed Log

Author

anonymous

over 4 years ago

Language

C++

Compiler

clang HEAD 12.0.0 (https://github.com/llvm/llvm-project.git 3bdf4507b66348ad78df4655a8e4f36c3fc10f3c)

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

Author

anonymous

over 4 years ago

$ clang++ prog.cc -Wall -Wextra -I/opt/wandbox/boost-1.73.0/clang-head/include -std=gnu++2a
prog.cc:7:8: warning: unused variable 'ar' [-Wunused-variable]
    A& ar = i;                                            // #2
       ^
prog.cc:6:5: error: static_assert failed due to requirement 'std::is_same_v<A, const A>'
    static_assert(std::is_same_v<decltype(i), A const>);  // #1
    ^             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
prog.cc:11:5: note: in instantiation of function template specialization 'f<{}>' requested here
    f<A{}>();
    ^
prog.cc:7:8: error: binding reference of type 'A' to value of type 'const A' drops 'const' qualifier
    A& ar = i;                                            // #2
       ^    ~
1 warning and 2 errors generated.
Exit Code:
1