diff options
| author | Roman Divacky <rdivacky@FreeBSD.org> | 2009-11-05 17:18:09 +0000 |
|---|---|---|
| committer | Roman Divacky <rdivacky@FreeBSD.org> | 2009-11-05 17:18:09 +0000 |
| commit | 8f57cb0305232cb53fff00ef151ca716766f3437 (patch) | |
| tree | 8b316eca843681b024034db1125707173b9adb4a /test/SemaTemplate/instantiate-expr-1.cpp | |
| parent | 51fb8b013e7734b795139f49d3b1f77c539be20a (diff) | |
Notes
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 13ee3ab525ba..fb88213c401b 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); +} |
