aboutsummaryrefslogtreecommitdiff
path: root/test/CXX/basic/basic.lookup/basic.lookup.unqual
diff options
context:
space:
mode:
Diffstat (limited to 'test/CXX/basic/basic.lookup/basic.lookup.unqual')
-rw-r--r--test/CXX/basic/basic.lookup/basic.lookup.unqual/p11.cpp12
-rw-r--r--test/CXX/basic/basic.lookup/basic.lookup.unqual/p12.cpp13
-rw-r--r--test/CXX/basic/basic.lookup/basic.lookup.unqual/p13.cpp8
-rw-r--r--test/CXX/basic/basic.lookup/basic.lookup.unqual/p14.cpp11
-rw-r--r--test/CXX/basic/basic.lookup/basic.lookup.unqual/p15.cpp17
-rw-r--r--test/CXX/basic/basic.lookup/basic.lookup.unqual/p3.cpp26
6 files changed, 87 insertions, 0 deletions
diff --git a/test/CXX/basic/basic.lookup/basic.lookup.unqual/p11.cpp b/test/CXX/basic/basic.lookup/basic.lookup.unqual/p11.cpp
new file mode 100644
index 000000000000..1b56ecd27d68
--- /dev/null
+++ b/test/CXX/basic/basic.lookup/basic.lookup.unqual/p11.cpp
@@ -0,0 +1,12 @@
+// RUN: clang-cc -fsyntax-only -verify %s
+
+static const int a = 10;
+
+void f0(int a,
+ int b = a) { // expected-error {{default argument references parameter 'a'}}
+}
+
+template<int a,
+ int b = a>
+class A {
+};
diff --git a/test/CXX/basic/basic.lookup/basic.lookup.unqual/p12.cpp b/test/CXX/basic/basic.lookup/basic.lookup.unqual/p12.cpp
new file mode 100644
index 000000000000..aee8acf5c05a
--- /dev/null
+++ b/test/CXX/basic/basic.lookup/basic.lookup.unqual/p12.cpp
@@ -0,0 +1,13 @@
+// RUN: clang-cc -fsyntax-only -verify %s
+
+struct S {};
+S E0;
+
+namespace {
+ enum {
+ E0 = 1,
+ E1 = E0 + 1
+ };
+}
+
+
diff --git a/test/CXX/basic/basic.lookup/basic.lookup.unqual/p13.cpp b/test/CXX/basic/basic.lookup/basic.lookup.unqual/p13.cpp
new file mode 100644
index 000000000000..afd662360572
--- /dev/null
+++ b/test/CXX/basic/basic.lookup/basic.lookup.unqual/p13.cpp
@@ -0,0 +1,8 @@
+// RUN: clang-cc -fsyntax-only -verify %s
+
+struct S {
+ static const int f0 = 0;
+ static int f1;
+};
+
+int S::f1 = f0;
diff --git a/test/CXX/basic/basic.lookup/basic.lookup.unqual/p14.cpp b/test/CXX/basic/basic.lookup/basic.lookup.unqual/p14.cpp
new file mode 100644
index 000000000000..b9b136c5061b
--- /dev/null
+++ b/test/CXX/basic/basic.lookup/basic.lookup.unqual/p14.cpp
@@ -0,0 +1,11 @@
+// RUN: clang-cc -fsyntax-only -verify %s
+// XFAIL
+
+namespace N {
+ struct S {};
+ S i;
+ extern S j;
+}
+
+int i = 2;
+N::S N::j = i;
diff --git a/test/CXX/basic/basic.lookup/basic.lookup.unqual/p15.cpp b/test/CXX/basic/basic.lookup/basic.lookup.unqual/p15.cpp
new file mode 100644
index 000000000000..9572aaa14273
--- /dev/null
+++ b/test/CXX/basic/basic.lookup/basic.lookup.unqual/p15.cpp
@@ -0,0 +1,17 @@
+// RUN: clang-cc -fsyntax-only -verify %s
+// XFAIL
+
+class C {
+public:
+ C(int a, int b);
+};
+
+C::C(int a, // expected-note {{previous definition}}
+ int b) // expected-note {{previous definition}}
+try {
+ int c;
+
+} catch (int a) { // expected-error {{redefinition of 'a'}}
+ int b; // expected-error {{redefinition of 'b'}}
+ ++c; // expected-error {{use of undeclared identifion 'c'}}
+}
diff --git a/test/CXX/basic/basic.lookup/basic.lookup.unqual/p3.cpp b/test/CXX/basic/basic.lookup/basic.lookup.unqual/p3.cpp
new file mode 100644
index 000000000000..1daf0ddec6c0
--- /dev/null
+++ b/test/CXX/basic/basic.lookup/basic.lookup.unqual/p3.cpp
@@ -0,0 +1,26 @@
+// RUN: clang-cc -fsyntax-only -verify %s
+// XFAIL
+
+// FIXME: This part is here to demonstrate the failure in looking up 'f', it can
+// be removed once the whole test passes.
+typedef int f;
+namespace N0 {
+ struct A {
+ friend void f();
+ void g() {
+ int i = f(1);
+ }
+ };
+}
+
+namespace N1 {
+ struct A {
+ friend void f(A &);
+ operator int();
+ void g(A a) {
+ // ADL should not apply to the lookup of 'f', it refers to the typedef
+ // above.
+ int i = f(a);
+ }
+ };
+}