summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/test/clang-tidy/google-explicit-constructor.cpp
diff options
context:
space:
mode:
authorAlexander Kornienko <alexfh@google.com>2014-11-30 19:41:41 +0000
committerAlexander Kornienko <alexfh@google.com>2014-11-30 19:41:41 +0000
commitad5074df0c1b9dfce7ff7094ca2b7ec7d4b2167f (patch)
tree65859833e14ff364dc49494c396ef7c3cab39faf /clang-tools-extra/test/clang-tidy/google-explicit-constructor.cpp
parent7432a64dcb0abf5282cb82420b0dd47db28facde (diff)
downloadbcm5719-llvm-ad5074df0c1b9dfce7ff7094ca2b7ec7d4b2167f.tar.gz
bcm5719-llvm-ad5074df0c1b9dfce7ff7094ca2b7ec7d4b2167f.zip
[clang-tidy] google-explicit-constructor: don't match in template instantiations
This helps avoiding false positives related to the recently added std::initializer_list<> handling. llvm-svn: 222981
Diffstat (limited to 'clang-tools-extra/test/clang-tidy/google-explicit-constructor.cpp')
-rw-r--r--clang-tools-extra/test/clang-tidy/google-explicit-constructor.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/clang-tools-extra/test/clang-tidy/google-explicit-constructor.cpp b/clang-tools-extra/test/clang-tidy/google-explicit-constructor.cpp
index fec8debd436..d198db7af65 100644
--- a/clang-tools-extra/test/clang-tidy/google-explicit-constructor.cpp
+++ b/clang-tools-extra/test/clang-tidy/google-explicit-constructor.cpp
@@ -78,3 +78,21 @@ struct C {
C(const initializer_list<unsigned> &list2) {}
C(initializer_list<unsigned> &&list3) {}
};
+
+struct D {
+ template <typename T>
+ explicit D(T t) {}
+};
+
+template <typename T>
+struct E {
+ explicit E(T t) {}
+ template <typename U>
+ explicit E(U u) {}
+};
+
+void f(std::initializer_list<int> list) {
+ D d(list);
+ E<decltype(list)> e(list);
+ E<int> e2(list);
+}
OpenPOWER on IntegriCloud