summaryrefslogtreecommitdiff
path: root/test/SemaCXX
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2012-05-03 16:53:59 +0000
committerDimitry Andric <dim@FreeBSD.org>2012-05-03 16:53:59 +0000
commit6b9a6e390fbb92c40eb9c6ac9e7abbd88dd7a767 (patch)
tree2e51705e103e92c7be1b21e8bd8ffd5b5d0e4d52 /test/SemaCXX
parentdbe13110f59f48b4dbb7552b3ac2935acdeece7f (diff)
Notes
Diffstat (limited to 'test/SemaCXX')
-rw-r--r--test/SemaCXX/constant-expression-cxx11.cpp4
-rw-r--r--test/SemaCXX/cxx98-compat.cpp6
-rw-r--r--test/SemaCXX/dependent-noexcept-unevaluated.cpp2
-rw-r--r--test/SemaCXX/implicit-exception-spec.cpp10
-rw-r--r--test/SemaCXX/warn-everthing.cpp8
-rw-r--r--test/SemaCXX/warn-thread-safety-parsing.cpp2
6 files changed, 17 insertions, 15 deletions
diff --git a/test/SemaCXX/constant-expression-cxx11.cpp b/test/SemaCXX/constant-expression-cxx11.cpp
index 41d214a6364bc..9f80e7169bb14 100644
--- a/test/SemaCXX/constant-expression-cxx11.cpp
+++ b/test/SemaCXX/constant-expression-cxx11.cpp
@@ -615,6 +615,10 @@ static_assert(agg1.arr[4] == 0, "");
static_assert(agg1.arr[5] == 0, ""); // expected-error {{constant expression}} expected-note {{read of dereferenced one-past-the-end}}
static_assert(agg1.p == nullptr, "");
+static constexpr const unsigned char uc[] = { "foo" };
+static_assert(uc[0] == 'f', "");
+static_assert(uc[3] == 0, "");
+
namespace SimpleDerivedClass {
struct B {
diff --git a/test/SemaCXX/cxx98-compat.cpp b/test/SemaCXX/cxx98-compat.cpp
index 47589135c9d5d..82a9dc8042c4a 100644
--- a/test/SemaCXX/cxx98-compat.cpp
+++ b/test/SemaCXX/cxx98-compat.cpp
@@ -114,12 +114,16 @@ bool no_except_expr = noexcept(1 + 1); // expected-warning {{noexcept expression
void *null = nullptr; // expected-warning {{'nullptr' is incompatible with C++98}}
static_assert(true, "!"); // expected-warning {{static_assert declarations are incompatible with C++98}}
+// FIXME: Reintroduce this test if support for inheriting constructors is
+// implemented.
+#if 0
struct InhCtorBase {
InhCtorBase(int);
};
struct InhCtorDerived : InhCtorBase {
- using InhCtorBase::InhCtorBase; // expected-warning {{inherited constructors are incompatible with C++98}}
+ using InhCtorBase::InhCtorBase; // xpected-warning {{inheriting constructors are incompatible with C++98}}
};
+#endif
struct FriendMember {
static void MemberFn();
diff --git a/test/SemaCXX/dependent-noexcept-unevaluated.cpp b/test/SemaCXX/dependent-noexcept-unevaluated.cpp
index 8066b859f1891..fad8d0918d530 100644
--- a/test/SemaCXX/dependent-noexcept-unevaluated.cpp
+++ b/test/SemaCXX/dependent-noexcept-unevaluated.cpp
@@ -23,7 +23,7 @@ struct array
{
T data[N];
- void swap(array& a) noexcept(noexcept(swap(declval<T&>(), declval<T&>())));
+ void swap(array& a) noexcept(noexcept(::swap(declval<T&>(), declval<T&>())));
};
struct DefaultOnly
diff --git a/test/SemaCXX/implicit-exception-spec.cpp b/test/SemaCXX/implicit-exception-spec.cpp
index 786e8f4a148e9..143d9f7cc877a 100644
--- a/test/SemaCXX/implicit-exception-spec.cpp
+++ b/test/SemaCXX/implicit-exception-spec.cpp
@@ -39,20 +39,14 @@ namespace InClassInitializers {
bool z = noexcept(Nested::Inner());
}
-// FIXME:
-// The same problem arises in delayed parsing of exception specifications,
-// which clang does not yet support.
namespace ExceptionSpecification {
- struct Nested { // expected-note {{not complete}}
+ struct Nested {
struct T {
- T() noexcept(!noexcept(Nested())); // expected-error {{incomplete type}}
+ T() noexcept(!noexcept(Nested())); // expected-error{{exception specification is not available until end of class definition}}
} t;
};
}
-// FIXME:
-// The same problem arises in delayed parsing of default arguments,
-// which clang does not yet support.
namespace DefaultArgument {
struct Default {
struct T {
diff --git a/test/SemaCXX/warn-everthing.cpp b/test/SemaCXX/warn-everthing.cpp
index 144a8f90df222..ad3dd8a24d88f 100644
--- a/test/SemaCXX/warn-everthing.cpp
+++ b/test/SemaCXX/warn-everthing.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang -Weverything -fsyntax-only %s -verify
+// RUN: %clang_cc1 -Weverything -fsyntax-only %s -verify
// This previously crashed due to a bug in the CFG. Exercising all
// warnings helps check CFG construction.
@@ -8,6 +8,6 @@ public:
~PR12271();
};
-void testPR12271() {
- PR12271 a[1][1];
-} \ No newline at end of file
+void testPR12271() { // expected-warning {{no previous prototype for function 'testPR12271'}}
+ PR12271 a[1][1]; // expected-warning {{unused variable 'a'}}
+}
diff --git a/test/SemaCXX/warn-thread-safety-parsing.cpp b/test/SemaCXX/warn-thread-safety-parsing.cpp
index 587cb8a4c729e..c2fa1d77a01a4 100644
--- a/test/SemaCXX/warn-thread-safety-parsing.cpp
+++ b/test/SemaCXX/warn-thread-safety-parsing.cpp
@@ -1255,7 +1255,7 @@ public:
void foo4(FooLate *f) __attribute__((exclusive_locks_required(f->mu)));
static void foo5() __attribute__((exclusive_locks_required(mu))); // \
- // expected-error {{invalid use of member 'mu' in static member function}}
+ // expected-error {{'this' cannot be implicitly used in a static member function declaration}}
template <class T>
void foo6() __attribute__((exclusive_locks_required(T::statmu))) { }