http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53573

Keean Schupke <ke...@fry-it.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ke...@fry-it.com

--- Comment #1 from Keean Schupke <ke...@fry-it.com> 2012-06-04 13:30:59 UTC ---
// test.cpp
//
// gcc-version: gcc (Gentoo 4.7.0 p1.0, pie-0.5.3) 4.7.0
// system-type: Linux Ra 3.0.29-tuxonice #4 SMP PREEMPT
//    Sat May 26 10:21:39 BST 2012
//    x86_64 Genuine Intel(R) CPU U7300 @ 1.30GHz GenuineIntel GNU/Linux
// compile options: g++ test.cpp
// compile output:
//    test.cpp: In instantiation of ‘T f(T) [with T = int]’:
//    test.cpp:27:9:   required from here
//    test.cpp:18:12: error: ‘g’ was not declared in this scope,
//    and no declarations were found by argument-dependent lookup
//    at the point of instantiation [-fpermissive]
//    test.cpp:21:5: note: ‘int g(int)’ declared here, later in the
//    translation unit

template <typename T> T f(T t) {
    return g(t);
}

int g(int x) {
    return x + 1;
}

main() {
    int x(1);
    x = f(x);
}

Reply via email to