diff options
author | Richard Trieu <rtrieu@google.com> | 2013-02-27 01:41:53 +0000 |
---|---|---|
committer | Richard Trieu <rtrieu@google.com> | 2013-02-27 01:41:53 +0000 |
commit | 954aaaf76b0dc5a7a30160ee06dc025d7a501a17 (patch) | |
tree | 6d2002d18341f70fa43a5ff78cd3972605425a00 /clang/test/Misc/diag-template-diffing.cpp | |
parent | f77453cf2247c7dd798f7a7351a9311de1fb65cc (diff) | |
download | bcm5719-llvm-954aaaf76b0dc5a7a30160ee06dc025d7a501a17.tar.gz bcm5719-llvm-954aaaf76b0dc5a7a30160ee06dc025d7a501a17.zip |
Update template diffing to handle template arguments that are declarations.
llvm-svn: 176153
Diffstat (limited to 'clang/test/Misc/diag-template-diffing.cpp')
-rw-r--r-- | clang/test/Misc/diag-template-diffing.cpp | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/clang/test/Misc/diag-template-diffing.cpp b/clang/test/Misc/diag-template-diffing.cpp index c6fc32d1b34..6be705511db 100644 --- a/clang/test/Misc/diag-template-diffing.cpp +++ b/clang/test/Misc/diag-template-diffing.cpp @@ -869,6 +869,40 @@ namespace rdar12931988 { } } +namespace ValueDecl { + int int1, int2, default_int; + template <const int& T = default_int> + struct S {}; + + typedef S<int1> T1; + typedef S<int2> T2; + typedef S<> TD; + + void test() { + T1 t1; + T2 t2; + TD td; + + t1 = t2; + // CHECK-ELIDE-NOTREE: no viable overloaded '=' + // CHECK-ELIDE-NOTREE: no known conversion from 'S<int2>' to 'S<int1>' + + t2 = t1; + // CHECK-ELIDE-NOTREE: no viable overloaded '=' + // CHECK-ELIDE-NOTREE: no known conversion from 'S<int1>' to 'S<int2>' + + td = t1; + // TODO: Find out why (default) isn't printed on second template. + // CHECK-ELIDE-NOTREE: no viable overloaded '=' + // CHECK-ELIDE-NOTREE: no known conversion from 'S<int1>' to 'S<default_int>' + + t2 = td; + // CHECK-ELIDE-NOTREE: no viable overloaded '=' + // CHECK-ELIDE-NOTREE: no known conversion from 'S<(default) default_int>' to 'S<int2>' + + } +} + // CHECK-ELIDE-NOTREE: {{[0-9]*}} errors generated. // CHECK-NOELIDE-NOTREE: {{[0-9]*}} errors generated. // CHECK-ELIDE-TREE: {{[0-9]*}} errors generated. |