aboutsummaryrefslogtreecommitdiff
path: root/clang/unittests/Tooling/RefactoringTest.cpp
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2017-06-30 20:57:39 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2017-06-30 20:57:39 +0000
commit2563984215a2a0ff13d1155e46548de1aee10a6d (patch)
tree2735ab6d8e898128a913ccfd0a6d1620236086bf /clang/unittests/Tooling/RefactoringTest.cpp
parent4451cb63fbb53b927c0e339d1cbce8e627a42c26 (diff)
downloadllvm-2563984215a2a0ff13d1155e46548de1aee10a6d.zip
llvm-2563984215a2a0ff13d1155e46548de1aee10a6d.tar.gz
llvm-2563984215a2a0ff13d1155e46548de1aee10a6d.tar.bz2
Fix ODR violations due to abuse of LLVM_YAML_IS_(FLOW_)?SEQUENCE_VECTOR
This is a short-term fix for PR33650 aimed to get the modules build bots green again. Remove all the places where we use the LLVM_YAML_IS_(FLOW_)?SEQUENCE_VECTOR macros to try to locally specialize a global template for a global type. That's not how C++ works. Instead, we now centrally define how to format vectors of fundamental types and of string (std::string and StringRef). We use flow formatting for the former cases, since that's the obvious right thing to do; in the latter case, it's less clear what the right choice is, but flow formatting is really bad for some cases (due to very long strings), so we pick block formatting. (Many of the cases that were using flow formatting for strings are improved by this change.) Other than the flow -> block formatting change for some vectors of strings, this should result in no functionality change. Differential Revision: https://reviews.llvm.org/D34907 Corresponding LLVM change is r306878. llvm-svn: 306881
Diffstat (limited to 'clang/unittests/Tooling/RefactoringTest.cpp')
-rw-r--r--clang/unittests/Tooling/RefactoringTest.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/clang/unittests/Tooling/RefactoringTest.cpp b/clang/unittests/Tooling/RefactoringTest.cpp
index 495ac75..1590094 100644
--- a/clang/unittests/Tooling/RefactoringTest.cpp
+++ b/clang/unittests/Tooling/RefactoringTest.cpp
@@ -1123,8 +1123,10 @@ TEST_F(AtomicChangeTest, AtomicChangeToYAML) {
"Key: 'input.cpp:20'\n"
"FilePath: input.cpp\n"
"Error: ''\n"
- "InsertedHeaders: [ a.h ]\n"
- "RemovedHeaders: [ b.h ]\n"
+ "InsertedHeaders: \n" // Extra whitespace here!
+ " - a.h\n"
+ "RemovedHeaders: \n" // Extra whitespace here!
+ " - b.h\n"
"Replacements: \n" // Extra whitespace here!
" - FilePath: input.cpp\n"
" Offset: 20\n"
@@ -1143,8 +1145,10 @@ TEST_F(AtomicChangeTest, YAMLToAtomicChange) {
"Key: 'input.cpp:20'\n"
"FilePath: input.cpp\n"
"Error: 'ok'\n"
- "InsertedHeaders: [ a.h ]\n"
- "RemovedHeaders: [ b.h ]\n"
+ "InsertedHeaders: \n" // Extra whitespace here!
+ " - a.h\n"
+ "RemovedHeaders: \n" // Extra whitespace here!
+ " - b.h\n"
"Replacements: \n" // Extra whitespace here!
" - FilePath: input.cpp\n"
" Offset: 20\n"