https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67910

--- Comment #5 from Guille <guille at cal dot berkeley.edu> ---
(In reply to Marc Glisse from comment #4)
> This seems to be already fixed on trunk.

Just tested on most recent gcc version 5.2.1 20151006 (GCC) and it doesn't
compile:


t.c: In function ‘int main()’:
t.c:10:12: error: conversion from ‘B’ to non-scalar type ‘A’ requested
     A a = f(B());
            ^
t.c: In instantiation of ‘auto:1 f(auto:1) [with auto:1 = B]’:
t.c:10:16:   required from here
t.c:6:39: error: could not convert ‘A()’ from ‘A’ to ‘B’
 static auto f(auto b) -> A { return A(); }
                                       ^

Reply via email to