This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/53573] template type dependent name resolution broken
- From: "keean at fry-it dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 04 Jun 2012 16:38:21 +0000
- Subject: [Bug c++/53573] template type dependent name resolution broken
- Auto-submitted: auto-generated
- References: <bug-53573-4@http.gcc.gnu.org/bugzilla/>
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 ]