[Bug c++/83476] Template argument deduction fails with reference template parameter

gufideg at gmail dot com gcc-bugzilla@gcc.gnu.org
Thu May 3 23:13:00 GMT 2018


Guillaume Racicot <gufideg at gmail dot com> changed:

           What    |Removed                     |Added
           Keywords|                            |rejects-valid
            Version|7.3.1                       |8.1.0
            Summary|Template argument deduction |Template argument deduction
                   |fails with reference auto   |fails with reference
                   |template parameter          |template parameter

--- Comment #1 from Guillaume Racicot <gufideg at gmail dot com> ---
Still happen with GCC 8.1. It also happen with normal reference template

Here's a simplified test case:

    template<int&> struct foo {};

    template<int& t>
    void deduce(foo<t>) {}

    extern int bar;
    int bar;

    int main() {

This example compiles in MSVC and Clang. https://godbolt.org/g/kxKkb5

More information about the Gcc-bugs mailing list