From 222e2a7620e6520ffaf4fc4e69d79c18da31542e Mon Sep 17 00:00:00 2001 From: "Zancanaro; Carlo" Date: Mon, 24 Sep 2012 09:58:17 +1000 Subject: Add the clang library to the repo (with some of my changes, too). --- clang/test/Parser/cxx-using-directive.cpp | 38 +++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 clang/test/Parser/cxx-using-directive.cpp (limited to 'clang/test/Parser/cxx-using-directive.cpp') diff --git a/clang/test/Parser/cxx-using-directive.cpp b/clang/test/Parser/cxx-using-directive.cpp new file mode 100644 index 0000000..1d781fb --- /dev/null +++ b/clang/test/Parser/cxx-using-directive.cpp @@ -0,0 +1,38 @@ +// RUN: %clang_cc1 -fsyntax-only -verify %s + +class A {}; + +namespace B { + namespace A {} // expected-note{{namespace '::B::A' defined here}} + using namespace A ; +} + +namespace C {} + +namespace D { + + class C { + + using namespace B ; // expected-error{{not allowed}} + }; + + namespace B {} + + using namespace C ; + using namespace B::A ; // expected-error{{no namespace named 'A' in namespace 'D::B'; did you mean '::B::A'?}} + using namespace ::B::A ; + using namespace ::D::C ; // expected-error{{expected namespace name}} +} + +using namespace ! ; // expected-error{{expected namespace name}} +using namespace A ; // expected-error{{expected namespace name}} +using namespace ::A // expected-error{{expected namespace name}} \ + // expected-error{{expected ';' after namespace name}} + B ; + +void test_nslookup() { + int B; + class C; + using namespace B; + using namespace C; +} -- cgit v1.2.3