aboutsummaryrefslogtreecommitdiff
path: root/test/SemaTemplate/instantiate-expr-1.cpp
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
commitf45b357c0d0df99e160a6320e279ef788dd91ba6 (patch)
tree31da465ce818fae2aaddffd579882968e75de116 /test/SemaTemplate/instantiate-expr-1.cpp
parent297b20ac5c1a638e650a7d85c2eab9916bb4ed57 (diff)
PR10864: make sure we correctly delay type-checking for inline asm tied operands with dependent type. Patch by Likai Liu.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139716 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/SemaTemplate/instantiate-expr-1.cpp')
-rw-r--r--test/SemaTemplate/instantiate-expr-1.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/test/SemaTemplate/instantiate-expr-1.cpp b/test/SemaTemplate/instantiate-expr-1.cpp
index 7af59fd2d1..896437488d 100644
--- a/test/SemaTemplate/instantiate-expr-1.cpp
+++ b/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}}
+ }
+}