Hi Clang developers, We here at Sony are continuing to update the Lit tests for C++ dialects compatibility. Attached is the second patch. (As a reference, here is the link to the discussion on the previous Lit patch. http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20150727/134667.html) In this second patch, there is 1 complicated change and 3 simple changes.
Here is the complicated change first.
test/Sema/switch-1.c
This test verifies the diagnostics for integer overflows.
Due to C++11's more strict requirements on constant-expressions in 5.19p2
[expr.const],
The diagnostics have changed from "overflow in expression" to "not a constant
expression".
Usually we would create a C++11 version of the switch-1.c file.
But here we propose a novel approach to "#ifdef" the expected diagnostics.
(We hope to use this approach for all similar cases in the future.)
Normally '// expected-error' does not honor any '#ifdef'.
But if we first preprocess the source into a temporary file, only the valid
'#ifdef' sections remain.
We then run the preprocessed file at the desired dialect.
The main downside to this approach is If the test fails, the errors are
reported on the temporary file, not on the original file, and the line numbers
of these two files do not match
Here are the simple changes.
test/Analysis/temp-obj-dtors-cfg-output.cpp
This test verifies CFG dump for temporary destructors
C++11 no longer has the following implicit cast.
(ImplicitCastExpr, NoOp, const struct D)
We modified the test using the #ifdef approach to have the preprocessor
generate the desired CHECK lines.
test/CodeCompletion/ordinary-name.cpp
This test verifies for code completion patterns.
Since C++11 has more keywords than C++98,
We made this test to be C++98 specific, and create a separate C++11 version.
test/CodeCompletion/ordinary-name-cxx11.cpp
This is the C++11 specific version of the code completion.
This test added patterns for the following keywords:
char16, char32, noexcept, nullptr, sizeof...,
auto, decltype, char16_t, char32_t
test/Sema/thread-specifier.c
Tests for __thread specifier at various C++ dialects
We made the default RUN line explicit to be at -std=c++98
If there is anything that seems confusing to you, please let me know.
I would be more than happy to expand on the reasons for the these changes.
Thanks,
Charles
lit_22.patch
Description: lit_22.patch
_______________________________________________ cfe-commits mailing list [email protected] http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
