diff options
author | Anders Carlsson <andersca@mac.com> | 2010-11-05 15:21:33 +0000 |
---|---|---|
committer | Anders Carlsson <andersca@mac.com> | 2010-11-05 15:21:33 +0000 |
commit | 343e6ffa70459b1afdb488c69fb651434a5016c0 (patch) | |
tree | a160e0b44d0b29c51e481e7352bddcfd2df84820 /test/SemaCXX/nullptr.cpp | |
parent | bf44c3b099602c9c967f1b20995919fb4ef39a51 (diff) |
Expressions of type std::nullptr_t can be used as sentinels.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118276 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/SemaCXX/nullptr.cpp')
-rw-r--r-- | test/SemaCXX/nullptr.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/test/SemaCXX/nullptr.cpp b/test/SemaCXX/nullptr.cpp index 0a0d098e36..4f6e2e6eb1 100644 --- a/test/SemaCXX/nullptr.cpp +++ b/test/SemaCXX/nullptr.cpp @@ -84,3 +84,12 @@ bool g(bool); // Test that we prefer g(void*) over g(bool). static_assert(is_same<decltype(g(nullptr)), void*>::value, ""); } + +namespace test2 { + void f(int, ...) __attribute__((sentinel)); + + void g() { + // nullptr can be used as the sentinel value. + f(10, nullptr); + } +} |