The issue reported by PR 66735 still exists. GCC would not bind const-reference init-captures to prvalues or xvalues. ### SOURCE (<stdin>): const int &&f(); void g() { [&r = f()] { }(); } ### COMPILER INVOCATION COMMAND: g++ -fsyntax-only -x c++ -std=c++14 - ### ACTUAL COMPILER OUTPUT: <stdin>: In function 'void g()': <stdin>:2:20: error: cannot capture 'f()' by reference ### EXPECTED COMPILER OUTPUT: (Clean compile). ### COMPILER VERSION INFO (g++ -v): Using built-in specs. COLLECT_GCC=/opt/wandbox/gcc-head/bin/g++ COLLECT_LTO_WRAPPER=/opt/wandbox/gcc-head/libexec/gcc/x86_64-pc-linux-gnu/9.0.0/lto-wrapper Target: x86_64-pc-linux-gnu Configured with: ../source/configure --prefix=/opt/wandbox/gcc-head --enable-languages=c,c++ --disable-multilib --without-ppl --without-cloog-ppl --enable-checking=release --disable-nls --enable-lto LDFLAGS=-Wl,-rpath,/opt/wandbox/gcc-head/lib,-rpath,/opt/wandbox/gcc-head/lib64,-rpath,/opt/wandbox/gcc-head/lib32 Thread model: posix gcc version 9.0.0 20181016 (experimental) (GCC)
Confirmed.