Created on 2003-06-18.00:00:00 last changed 255 months ago
Notes from the October 2003 meeting:
We believe that all these cases should be allowed, and that errors should be required only when an instance of the template is generated. The current standard wording does not seem to disallow such cases, so no change is required.
Is the following valid?
template <class T> void f(T) { typedef int x; typedef T x; } int main() { f(1); }
There is an instantiation where the function is valid. Is an implementation allowed to issue an error on the template declaration because the types on the typedef are not the same (9.2.4 [dcl.typedef])?
How about
typedef T x; typedef T2 x;?
It can be argued that these cases should be allowed because they aren't necessarily wrong, but it can also be argued that there's no reason to write things like the first case above, and if such a case appears it's more likely to be a mistake than some kind of intentional test that int and T are the same type.
History | |||
---|---|---|---|
Date | User | Action | Args |
2003-11-15 00:00:00 | admin | set | messages: + msg948 |
2003-11-15 00:00:00 | admin | set | status: open -> nad |
2003-06-18 00:00:00 | admin | create |