diff options
Diffstat (limited to 'test/SemaTemplate/instantiate-expr-1.cpp')
-rw-r--r-- | test/SemaTemplate/instantiate-expr-1.cpp | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/test/SemaTemplate/instantiate-expr-1.cpp b/test/SemaTemplate/instantiate-expr-1.cpp index 13ee3ab525ba6..fb88213c401be 100644 --- a/test/SemaTemplate/instantiate-expr-1.cpp +++ b/test/SemaTemplate/instantiate-expr-1.cpp @@ -1,5 +1,4 @@ // RUN: clang-cc -fsyntax-only -verify %s - template<int I, int J> struct Bitfields { int simple : I; // expected-error{{bit-field 'simple' has zero width}} @@ -69,3 +68,29 @@ void test_BitfieldNeg() { (void)sizeof(BitfieldNeg2<int, -5>); // okay (void)sizeof(BitfieldNeg2<int, 5>); // expected-note{{in instantiation of template class 'struct BitfieldNeg2<int, 5>' requested here}} } + +template<typename T> +void increment(T &x) { + (void)++x; +} + +struct Incrementable { + Incrementable &operator++(); +}; + +void test_increment(Incrementable inc) { + increment(inc); +} + +template<typename T> +void add(const T &x) { + (void)(x + x); +} + +struct Addable { + Addable operator+(const Addable&) const; +}; + +void test_add(Addable &a) { + add(a); +} |