Howard Hinnant - non-ambiguous typedefs (original) (raw)
This is the mail archive of the gcc@gcc.gnu.orgmailing 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] |
- From: Howard Hinnant
- To: gcc at gcc dot gnu dot org
- Date: Tue, 8 Nov 2005 21:20:55 -0500
- Subject: non-ambiguous typedefs
Hi All,I'm wondering if the following behavior is:
- An already reported bug.
- Not reported, I need to file a bugzilla.
- Disputed.
Here's the test case:typedef unsigned short ushort;
namespace X { typedef unsigned short ushort; }
using namespace X;
int main() { ushort us = 0; }
We currently get:error: 'ushort' was not declared in this scopeThe deal is that the typedef ushort is defined in two different places, to the same type, and then brought "in conflict" via a using declaration. But since the two typedefs refer to the same type, I expect that the compiler will see that there is no conflict, and proceed without error or warning (reference C++03 7.1.3p2).Had the two typedefs referred to different types, I expect the compiler to complain about an ambiguity, for example:typedef unsigned short ushort;
namespace X { typedef short ushort; }
using namespace X;
int main() { ushort us = 0; }
error: ambiguous access to name found 'ushort' and 'X::ushort'-Howard
- Follow-Ups:
- Re: non-ambiguous typedefs
* From: Gabriel Dos Reis
- Re: non-ambiguous typedefs
| Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
|---|---|---|
| Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |