summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaTemplate
diff options
context:
space:
mode:
authorEli Friedman <eli.friedman@gmail.com>2011-09-14 19:20:00 +0000
committerEli Friedman <eli.friedman@gmail.com>2011-09-14 19:20:00 +0000
commit8eac6c2187266783ee15be89a803f2a7b10a7cdd (patch)
tree4a70ba890cd30527aa95faa60999fed58a1cf323 /clang/test/SemaTemplate
parentc39c2dfe1517547965560cf494a5035f9f02d9c0 (diff)
downloadbcm5719-llvm-8eac6c2187266783ee15be89a803f2a7b10a7cdd.tar.gz
bcm5719-llvm-8eac6c2187266783ee15be89a803f2a7b10a7cdd.zip
PR10864: make sure we correctly delay type-checking for inline asm tied operands with dependent type. Patch by Likai Liu.
llvm-svn: 139716
Diffstat (limited to 'clang/test/SemaTemplate')
-rw-r--r--clang/test/SemaTemplate/instantiate-expr-1.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/clang/test/SemaTemplate/instantiate-expr-1.cpp b/clang/test/SemaTemplate/instantiate-expr-1.cpp
index 7af59fd2d11..896437488d6 100644
--- a/clang/test/SemaTemplate/instantiate-expr-1.cpp
+++ b/clang/test/SemaTemplate/instantiate-expr-1.cpp
@@ -170,3 +170,16 @@ namespace PR6424 {
template void Y2<3>::f();
}
+
+namespace PR10864 {
+ template<typename T> class Vals {};
+ template<> class Vals<int> { public: static const int i = 1; };
+ template<> class Vals<float> { public: static const double i; };
+ template<typename T> void test_asm_tied(T o) {
+ __asm("addl $1, %0" : "=r" (o) : "0"(Vals<T>::i)); // expected-error {{input with type 'double' matching output with type 'float'}}
+ }
+ void test_asm_tied() {
+ test_asm_tied(1);
+ test_asm_tied(1.f); // expected-note {{instantiation of}}
+ }
+}
OpenPOWER on IntegriCloud