From 5f8de423f190bbb79a62f804151bc24824fa32d8 Mon Sep 17 00:00:00 2001 From: "Matt A. Tobin" Date: Fri, 2 Feb 2018 04:16:08 -0500 Subject: Add m-esr52 at 52.6.0 --- build/clang-plugin/tests/TestNonMemMovableStd.cpp | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 build/clang-plugin/tests/TestNonMemMovableStd.cpp (limited to 'build/clang-plugin/tests/TestNonMemMovableStd.cpp') diff --git a/build/clang-plugin/tests/TestNonMemMovableStd.cpp b/build/clang-plugin/tests/TestNonMemMovableStd.cpp new file mode 100644 index 000000000..9fce52496 --- /dev/null +++ b/build/clang-plugin/tests/TestNonMemMovableStd.cpp @@ -0,0 +1,21 @@ +#define MOZ_NEEDS_MEMMOVABLE_TYPE __attribute__((annotate("moz_needs_memmovable_type"))) + +template +class MOZ_NEEDS_MEMMOVABLE_TYPE Mover { T mForceInst; }; // expected-error-re 4 {{Cannot instantiate 'Mover<{{.*}}>' with non-memmovable template argument '{{.*}}'}} + +namespace std { +// In theory defining things in std:: like this invokes undefined +// behavior, but in practice it's good enough for this test case. +template class basic_string { }; +typedef basic_string string; +template class pair { T mT; U mU; }; // expected-note {{std::pair >' is a non-memmove()able type because member 'mU' is a non-memmove()able type 'std::basic_string'}} +class arbitrary_name { }; +} + +class HasString { std::string m; }; // expected-note {{'HasString' is a non-memmove()able type because member 'm' is a non-memmove()able type 'std::string' (aka 'basic_string')}} + +static Mover bad; // expected-note {{instantiation of 'Mover >' requested here}} +static Mover bad_mem; // expected-note {{instantiation of 'Mover' requested here}} +static Mover assumed_bad; // expected-note {{instantiation of 'Mover' requested here}} +static Mover> good; +static Mover> not_good; // expected-note {{instantiation of 'Mover > >' requested here}} -- cgit v1.2.3