Wandbox
SettingsLog
SettingsLog
Language
GitHubLogin
Ran/Viewed Log

Author

anonymous

over 1 year ago

Language

C++

Compiler

gcc HEAD 14.0.0 20231116 (experimental)

Options
Warnings
Don't Use Boost
C++2a
no pedantic

Author

anonymous

over 1 year ago

$ g++ prog.cc -Wall -Wextra -std=c++2a
prog.cc: In function 'int main()':
prog.cc:15:16: error: no matching function for call to 'test<S<10>()>()'
   15 |   test<S<10>{}>();
      |   ~~~~~~~~~~~~~^~
prog.cc:3:24: note: candidate: 'template<auto C> void test()'
    3 | template <auto C> void test() {}
      |                        ^~~~
prog.cc:3:24: note:   template argument deduction/substitution failed:
prog.cc:15:16: error: 'S<10>{int [10](), ((int*)(&<anonymous>.S<10>::a_))}' is not a constant expression
   15 |   test<S<10>{}>();
      |   ~~~~~~~~~~~~~^~
prog.cc:15:16: error: 'S<10>()' is not a constant expression because it refers to an incompletely initialized variable
Exit Code:
1