summaryrefslogtreecommitdiffstats
path: root/test/CXX
diff options
context:
space:
mode:
Diffstat (limited to 'test/CXX')
-rw-r--r--test/CXX/basic/basic.link/p9.cpp11
-rw-r--r--test/CXX/basic/basic.lookup/basic.lookup.unqual/p15.cpp2
-rw-r--r--test/CXX/dcl.decl/dcl.meaning/dcl.fct.default/p4.cpp4
-rw-r--r--test/CXX/temp/temp.decls/temp.class.spec/temp.class.spec.mfunc/p1.cpp1
-rw-r--r--test/CXX/temp/temp.decls/temp.class/temp.mem.func/p1.cpp34
-rw-r--r--test/CXX/temp/temp.param/p2.cpp3
-rw-r--r--test/CXX/temp/temp.param/p9.cpp23
7 files changed, 72 insertions, 6 deletions
diff --git a/test/CXX/basic/basic.link/p9.cpp b/test/CXX/basic/basic.link/p9.cpp
new file mode 100644
index 0000000..ecff3ee
--- /dev/null
+++ b/test/CXX/basic/basic.link/p9.cpp
@@ -0,0 +1,11 @@
+// RUN: clang-cc -fsyntax-only -verify %s
+
+// FIXME: This test is woefully incomplete.
+namespace N { } // expected-note{{here}}
+
+// First bullet: two names with external linkage that refer to
+// different kinds of entities.
+void f() {
+ int N(); // expected-error{{redefinition}}
+}
+
diff --git a/test/CXX/basic/basic.lookup/basic.lookup.unqual/p15.cpp b/test/CXX/basic/basic.lookup/basic.lookup.unqual/p15.cpp
index cebc3e9..418059d 100644
--- a/test/CXX/basic/basic.lookup/basic.lookup.unqual/p15.cpp
+++ b/test/CXX/basic/basic.lookup/basic.lookup.unqual/p15.cpp
@@ -13,5 +13,5 @@ try {
} catch (int a) { // expected-error {{redefinition of 'a'}}
int b; // expected-error {{redefinition of 'b'}}
- ++c; // expected-error {{use of undeclared identifion 'c'}}
+ ++c; // expected-error {{use of undeclared identifier 'c'}}
}
diff --git a/test/CXX/dcl.decl/dcl.meaning/dcl.fct.default/p4.cpp b/test/CXX/dcl.decl/dcl.meaning/dcl.fct.default/p4.cpp
index 4b15828..0cb8186 100644
--- a/test/CXX/dcl.decl/dcl.meaning/dcl.fct.default/p4.cpp
+++ b/test/CXX/dcl.decl/dcl.meaning/dcl.fct.default/p4.cpp
@@ -41,8 +41,8 @@ namespace N1 {
void m()
{
- void f(int, int); // expected-note{{candidate}}
- f(4); // expected-error{{no matching}}
+ void f(int, int);
+ f(4); // expected-error{{too few arguments to function call}}
void f(int, int = 5); // expected-note{{previous definition}}
f(4); // okay
void f(int, int = 5); // expected-error{{redefinition of default argument}}
diff --git a/test/CXX/temp/temp.decls/temp.class.spec/temp.class.spec.mfunc/p1.cpp b/test/CXX/temp/temp.decls/temp.class.spec/temp.class.spec.mfunc/p1.cpp
index b63c56c..90bb162 100644
--- a/test/CXX/temp/temp.decls/temp.class.spec/temp.class.spec.mfunc/p1.cpp
+++ b/test/CXX/temp/temp.decls/temp.class.spec/temp.class.spec.mfunc/p1.cpp
@@ -1,5 +1,4 @@
// RUN: clang-cc -fsyntax-only -verify %s
-
template<typename T, int N>
struct A;
diff --git a/test/CXX/temp/temp.decls/temp.class/temp.mem.func/p1.cpp b/test/CXX/temp/temp.decls/temp.class/temp.mem.func/p1.cpp
index 725b61c..6c82720 100644
--- a/test/CXX/temp/temp.decls/temp.class/temp.mem.func/p1.cpp
+++ b/test/CXX/temp/temp.decls/temp.class/temp.mem.func/p1.cpp
@@ -1,5 +1,4 @@
// RUN: clang-cc -fsyntax-only -verify %s
-
template<typename T, typename U> // expected-note{{previous template}}
class X0 {
public:
@@ -66,3 +65,36 @@ X0<T, U>::operator T*() const {
namespace N { template <class X> class A {void a();}; }
namespace N { template <class X> void A<X>::a() {} }
+
+// PR5566
+template<typename T>
+struct X1 {
+ template<typename U>
+ struct B { void f(); };
+};
+
+template<typename T>
+template<typename U>
+void X1<T>::template B<U>::f() { }
+
+// PR5527
+template <template <class> class T>
+class X2 {
+ template <class F>
+ class Bar {
+ void Func();
+ };
+};
+
+template <template <class> class T>
+template <class F>
+void X2<T>::Bar<F>::Func() {}
+
+// PR5528
+template <template <class> class T>
+class X3 {
+ void F();
+};
+
+template <template <class> class T>
+void X3<T>::F() {}
diff --git a/test/CXX/temp/temp.param/p2.cpp b/test/CXX/temp/temp.param/p2.cpp
index a402cf6..d40f99b 100644
--- a/test/CXX/temp/temp.param/p2.cpp
+++ b/test/CXX/temp/temp.param/p2.cpp
@@ -8,7 +8,8 @@ template<typename T> struct X;
// typename followed by aqualified-id denotes the type in a non-type
// parameter-declaration.
-// FIXME: template<typename T, typename T::type Value> struct Y;
+template<typename T, typename T::type Value> struct Y0;
+template<typename T, typename X<T>::type Value> struct Y1;
// A storage class shall not be specified in a template-parameter declaration.
template<static int Value> struct Z; // FIXME: expect an error
diff --git a/test/CXX/temp/temp.param/p9.cpp b/test/CXX/temp/temp.param/p9.cpp
new file mode 100644
index 0000000..d6b7405
--- /dev/null
+++ b/test/CXX/temp/temp.param/p9.cpp
@@ -0,0 +1,23 @@
+// RUN: clang-cc -fsyntax-only -std=c++98 -verify %s
+
+// A default template-argument shall not be specified in a function
+// template declaration or a function template definition
+template<typename T = int> // expected-error{{cannot have a default argument}}
+ void foo0(T);
+template<typename T = int> // expected-error{{cannot have a default argument}}
+ void foo1(T) { }
+
+// [...] nor in the template-parameter-list of the definition of a
+// member of a class template.
+template<int N>
+struct X0 {
+ void f();
+};
+
+template<int N = 0> // expected-error{{cannot add a default template argument}}
+void X0<N>::f() { }
+
+class X1 {
+ template<template<int> class TT = X0> // expected-error{{not permitted on a friend template}}
+ friend void f2();
+};
OpenPOWER on IntegriCloud