summaryrefslogtreecommitdiffstats
path: root/clang/test/Misc/diag-template-diffing.cpp
diff options
context:
space:
mode:
authorRichard Trieu <rtrieu@google.com>2014-07-22 03:33:01 +0000
committerRichard Trieu <rtrieu@google.com>2014-07-22 03:33:01 +0000
commit965cfa1d5bcb926b13591ed8838195bdfe956e5d (patch)
tree3e94f82251b20cb30797d15c69ce008e8dc38f6a /clang/test/Misc/diag-template-diffing.cpp
parent47bdc929e38d2a775cbd65adcb4efeff04540fca (diff)
downloadbcm5719-llvm-965cfa1d5bcb926b13591ed8838195bdfe956e5d.tar.gz
bcm5719-llvm-965cfa1d5bcb926b13591ed8838195bdfe956e5d.zip
Fix a template diffing problem were an '&' is unexpectedly printed in
a template argument. llvm-svn: 213609
Diffstat (limited to 'clang/test/Misc/diag-template-diffing.cpp')
-rw-r--r--clang/test/Misc/diag-template-diffing.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/clang/test/Misc/diag-template-diffing.cpp b/clang/test/Misc/diag-template-diffing.cpp
index c43ed263c69..41cdca47126 100644
--- a/clang/test/Misc/diag-template-diffing.cpp
+++ b/clang/test/Misc/diag-template-diffing.cpp
@@ -1105,6 +1105,22 @@ using F = C<21 + 21>;
}
}
+namespace AddressOf {
+template <int*>
+struct S {};
+
+template <class T>
+struct Wrapper {};
+
+template <class T>
+Wrapper<T> MakeWrapper();
+int global;
+constexpr int * ptr = nullptr;
+Wrapper<S<ptr>> W = MakeWrapper<S<&global>>();
+// Don't print an extra '&' for 'ptr'
+// CHECK-ELIDE-NOTREE: no viable conversion from 'Wrapper<S<&global>>' to 'Wrapper<S<ptr>>'
+}
+
// CHECK-ELIDE-NOTREE: {{[0-9]*}} errors generated.
// CHECK-NOELIDE-NOTREE: {{[0-9]*}} errors generated.
// CHECK-ELIDE-TREE: {{[0-9]*}} errors generated.
OpenPOWER on IntegriCloud