diff options
| author | David Blaikie <dblaikie@gmail.com> | 2013-07-13 18:08:59 +0000 |
|---|---|---|
| committer | David Blaikie <dblaikie@gmail.com> | 2013-07-13 18:08:59 +0000 |
| commit | 4cffb8ed5caf6617a510bc3e985e3e81a4861edf (patch) | |
| tree | 28f6889ce232fca90b26fbe3f34aab4400bac041 /clang/unittests/AST | |
| parent | 8e01ae895d0393e54633e4808c57346bba3a235d (diff) | |
| download | bcm5719-llvm-4cffb8ed5caf6617a510bc3e985e3e81a4861edf.tar.gz bcm5719-llvm-4cffb8ed5caf6617a510bc3e985e3e81a4861edf.zip | |
PR16540: ASTVector::insert(Context, Iter, Element) doesn't compile
Fix some uninstantiable code in ASTVector::insert. I've added a
cheap-and-dirty compile test for this, because I don't have the time to
figure out a nice way to get a real ASTContext to implement executable
tests - but we probably should have them for this ADT.
llvm-svn: 186253
Diffstat (limited to 'clang/unittests/AST')
| -rw-r--r-- | clang/unittests/AST/ASTVectorTest.cpp | 26 | ||||
| -rw-r--r-- | clang/unittests/AST/CMakeLists.txt | 1 |
2 files changed, 27 insertions, 0 deletions
diff --git a/clang/unittests/AST/ASTVectorTest.cpp b/clang/unittests/AST/ASTVectorTest.cpp new file mode 100644 index 00000000000..f8527432d26 --- /dev/null +++ b/clang/unittests/AST/ASTVectorTest.cpp @@ -0,0 +1,26 @@ +//===- unittests/AST/DeclTest.cpp --- Declaration tests -------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +// +// Unit tests for the ASTVector container. +// +//===----------------------------------------------------------------------===// + +#include "llvm/Support/Compiler.h" +#include "clang/AST/ASTVector.h" +#include "clang/Basic/TargetInfo.h" +#include "clang/Frontend/CompilerInstance.h" +#include "gtest/gtest.h" + +using namespace clang; + +LLVM_ATTRIBUTE_UNUSED void CompileTest() { + ASTContext *C = 0; + ASTVector<int> V; + V.insert(*C, V.begin(), 0); +} diff --git a/clang/unittests/AST/CMakeLists.txt b/clang/unittests/AST/CMakeLists.txt index c414ae3b237..70f86d3c730 100644 --- a/clang/unittests/AST/CMakeLists.txt +++ b/clang/unittests/AST/CMakeLists.txt @@ -1,6 +1,7 @@ add_clang_unittest(ASTTests ASTContextParentMapTest.cpp ASTTypeTraitsTest.cpp + ASTVectorTest.cpp CommentLexer.cpp CommentParser.cpp DeclPrinterTest.cpp |

