summaryrefslogtreecommitdiffstats
path: root/clang/test/Misc/diag-template-diffing.cpp
diff options
context:
space:
mode:
authorEli Friedman <eli.friedman@gmail.com>2012-12-18 23:32:47 +0000
committerEli Friedman <eli.friedman@gmail.com>2012-12-18 23:32:47 +0000
commit40ea264c25250abf6f209183167448475c33fc19 (patch)
tree01ff57def38b24a3a0b3ef37b33eff59befc5629 /clang/test/Misc/diag-template-diffing.cpp
parentd742533dbc43f54798becb48ed7d3a2d97cf8150 (diff)
downloadbcm5719-llvm-40ea264c25250abf6f209183167448475c33fc19.tar.gz
bcm5719-llvm-40ea264c25250abf6f209183167448475c33fc19.zip
Fix a crash in diagnostic printing when a template class type is diff'ed
against itself. PR14489. llvm-svn: 170474
Diffstat (limited to 'clang/test/Misc/diag-template-diffing.cpp')
-rw-r--r--clang/test/Misc/diag-template-diffing.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/clang/test/Misc/diag-template-diffing.cpp b/clang/test/Misc/diag-template-diffing.cpp
index 7d01f4695b0..e7a80488706 100644
--- a/clang/test/Misc/diag-template-diffing.cpp
+++ b/clang/test/Misc/diag-template-diffing.cpp
@@ -800,6 +800,18 @@ namespace PR14342 {
// CHECK-ELIDE-NOTREE: error: no viable conversion from 'X<[...], 2>' to 'X<[...], 3UL>'
}
+namespace PR14489 {
+ // The important thing here is that the diagnostic diffs a template specialization
+ // with no arguments against itself. (We might need a different test if this
+ // diagnostic changes).
+ template<class ...V>
+ struct VariableList {
+ void ConnectAllToAll(VariableList<>& params = VariableList<>()) {
+ }
+ };
+ // CHECK-ELIDE-NOTREE: non-const lvalue reference to type 'VariableList<>' cannot bind to a temporary of type 'VariableList<>'
+}
+
// CHECK-ELIDE-NOTREE: {{[0-9]*}} errors generated.
// CHECK-NOELIDE-NOTREE: {{[0-9]*}} errors generated.
// CHECK-ELIDE-TREE: {{[0-9]*}} errors generated.
OpenPOWER on IntegriCloud