The following are unit tests for the language bits of the rvalue reference proposal N2118. Some of the tests are negative tests. That is, the correct answer is a compile time error. Unfortuantely it is not possible to write such a test portbably. I've chosen to follow the style of DejaGnu for the negative tests, which also involves at least partially matching error messages. These messages may need to be adjusted for different compilers. Everywhere a compile time error is expected there is a comment of the form:
// { dg-error "some error message" }
There also exist several lines commented with:
// { dg-error "" }
which indicates this line may be included as extra information in the error message.
Some files contain multiple negative tests. However no file contains both negative tests and positive (expected not to fail) tests.
If the test contains this comment near the top:
// { dg-do compile }
Then it is a compile time test. If it compiles (and it is a positive test), then it passes.
If the test contains this comment near the top:
// { dg-do run }
Then it is a run time test. It should run and return 0. If it has a run time failure, it is likely to be an assert.