summaryrefslogtreecommitdiffstats
path: root/test/SemaTemplate/instantiate-expr-1.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/SemaTemplate/instantiate-expr-1.cpp')
-rw-r--r--test/SemaTemplate/instantiate-expr-1.cpp25
1 files changed, 25 insertions, 0 deletions
diff --git a/test/SemaTemplate/instantiate-expr-1.cpp b/test/SemaTemplate/instantiate-expr-1.cpp
index 663749d..d1b05f6 100644
--- a/test/SemaTemplate/instantiate-expr-1.cpp
+++ b/test/SemaTemplate/instantiate-expr-1.cpp
@@ -87,6 +87,18 @@ void add(const T &x) {
(void)(x + x);
}
+namespace PR6237 {
+ template <typename T>
+ void f(T t) {
+ t++;
+ }
+
+ struct B { };
+ B operator++(B &, int);
+
+ template void f(B);
+}
+
struct Addable {
Addable operator+(const Addable&) const;
};
@@ -112,3 +124,16 @@ void test_call_operator(CallOperator call_op, int i, double d) {
int &ir = test_call_operator<int&>(call_op, i);
double &dr = test_call_operator<double&>(call_op, d);
}
+
+template<typename T>
+void test_asm(T t) {
+ asm ("nop" : "=a"(*t) : "r"(*t)); // expected-error {{indirection requires pointer operand ('int' invalid)}}
+}
+
+void test_asm() {
+ int* a;
+ test_asm(a);
+
+ int b;
+ test_asm(b); // expected-note {{in instantiation of function template specialization 'test_asm<int>' requested here}}
+}
OpenPOWER on IntegriCloud