This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/53573] template type dependent name resolution broken


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

--- Comment #4 from Keean Schupke <keean@fry-it.com> 2012-06-04 16:38:21 UTC ---
From C++ Standard N3242=11-0012 14.6 Name Resolution

10. If a name does not depend on a template-parameter (as deïned in 14.6.2), a
declaration (or set of declarations) for that name shall be in scope at the
point where the name appears in the template deïnition; the name is bound to
the declaration (or declarations) found at that point and this binding is not
aïected by declarations that are visible at the point of instantiation.
[Example:

    void f(char);

    template<class T> void g(T t) {
        f(1); // f(char)
        f(T(1)); // dependent
        f(t); // dependent
        dd++; // not dependent
        // error: declaration for dd not found
    }

    enum E { e };
    void f(E);

    double dd;
    void h() {
        g(e); // will cause one call of f(char) followed
        // by two calls of f(E)
        g(âaâ); // will cause three calls of f(char)
    }

â end example ]


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]