【发布时间】:2015-10-16 04:59:18
【问题描述】:
根据 c++ 标准,以下程序是良构的还是良构的?
namespace N { int i; }
using namespace N;
using ::i;
int main() {}
我使用不同的编译器得到不同的结果:
- Clang (http://melpon.org/wandbox/permlink/c8vl7XbumyyS6vsw):没有错误。
- GCC (http://melpon.org/wandbox/permlink/immhNeWFCMcCA800):错误:“我”未声明。
根据 c++ 标准,这个程序是良构的还是良构的?需要对 c++ 标准的引用。
我正在尝试找出应该为哪个编译器提交错误。
【问题讨论】:
标签: c++ language-lawyer using-directives name-lookup using-declaration