aboutsummaryrefslogtreecommitdiff
path: root/test/CXX/basic/basic.scope/basic.scope.hiding/p2.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2010-10-23 16:06:17 +0000
committerDouglas Gregor <dgregor@apple.com>2010-10-23 16:06:17 +0000
commit77a1a8868e03bb74412f001f32d66ce0c26afae6 (patch)
treee69129b938e94153f77bc4264fffe132fcb07379 /test/CXX/basic/basic.scope/basic.scope.hiding/p2.cpp
parent14bd96571ef6f0e97dc79ec4d01b547d60e8fa68 (diff)
C++ [basic.scope.hiding] allows an ordinary name to hide a non-tag
name *in the same scope*, but not across scopes. Implement the highlighted condition. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117212 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CXX/basic/basic.scope/basic.scope.hiding/p2.cpp')
-rw-r--r--test/CXX/basic/basic.scope/basic.scope.hiding/p2.cpp24
1 files changed, 24 insertions, 0 deletions
diff --git a/test/CXX/basic/basic.scope/basic.scope.hiding/p2.cpp b/test/CXX/basic/basic.scope/basic.scope.hiding/p2.cpp
new file mode 100644
index 0000000000..911df98953
--- /dev/null
+++ b/test/CXX/basic/basic.scope/basic.scope.hiding/p2.cpp
@@ -0,0 +1,24 @@
+// RUN: %clang_cc1 -fsyntax-only -verify %s
+
+// rdar4641403
+namespace N {
+ struct X { // expected-note{{candidate found by name lookup}}
+ float b;
+ };
+}
+
+using namespace N;
+
+typedef struct {
+ int a;
+} X; // expected-note{{candidate found by name lookup}}
+
+
+struct Y { };
+void Y(int) { }
+
+void f() {
+ X *x; // expected-error{{reference to 'X' is ambiguous}}
+ Y(1); // okay
+}
+