diff options
author | Enea Zaffanella <zaffanella@cs.unipr.it> | 2013-07-19 18:02:36 +0000 |
---|---|---|
committer | Enea Zaffanella <zaffanella@cs.unipr.it> | 2013-07-19 18:02:36 +0000 |
commit | 25723ce6fce0a96e1a126502aab684e2c238f571 (patch) | |
tree | 13c89ea79eb195c0ec99979682999abfabd8db92 /clang/unittests/AST/SourceLocationTest.cpp | |
parent | 875356ade3e1c91d0f26cdfa08ee69ad41ec8e52 (diff) | |
download | llvm-25723ce6fce0a96e1a126502aab684e2c238f571.zip llvm-25723ce6fce0a96e1a126502aab684e2c238f571.tar.gz llvm-25723ce6fce0a96e1a126502aab684e2c238f571.tar.bz2 |
Fix source range of implicitly instantiated friend declaration.
llvm-svn: 186702
Diffstat (limited to 'clang/unittests/AST/SourceLocationTest.cpp')
-rw-r--r-- | clang/unittests/AST/SourceLocationTest.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/clang/unittests/AST/SourceLocationTest.cpp b/clang/unittests/AST/SourceLocationTest.cpp index 49ecfd3..d45c644 100644 --- a/clang/unittests/AST/SourceLocationTest.cpp +++ b/clang/unittests/AST/SourceLocationTest.cpp @@ -244,5 +244,18 @@ TEST(UnresolvedUsingValueDecl, SourceRange) { unresolvedUsingValueDecl())); } +TEST(FriendDecl, InstantiationSourceRange) { + RangeVerifier<FriendDecl> Verifier; + Verifier.expectRange(4, 3, 4, 35); + EXPECT_TRUE(Verifier.match( + "template <typename T> class S;\n" + "template<class T> void operator+(S<T> x);\n" + "template<class T> struct S {\n" + " friend void operator+<>(S<T> src);\n" + "};\n" + "void test(S<double> s) { +s; }", + friendDecl(hasParent(recordDecl(isTemplateInstantiation()))))); +} + } // end namespace ast_matchers } // end namespace clang |