Richard Smith | ace21ba | 2013-07-14 02:01:48 +0000 | [diff] [blame] | 1 | // RUN: rm -rf %t |
| 2 | // RUN: %clang_cc1 -x objective-c++ -fmodules -fmodules-cache-path=%t -I %S/Inputs %s -verify -std=c++11 |
| 3 | |
| 4 | // expected-no-diagnostics |
| 5 | |
Stephen Hines | 6bcf27b | 2014-05-29 04:14:42 -0700 | [diff] [blame^] | 6 | void use_implicit_new() { operator new[](3); } |
| 7 | |
Richard Smith | 868edfa | 2013-08-30 00:23:29 +0000 | [diff] [blame] | 8 | @import dummy; |
Richard Smith | ace21ba | 2013-07-14 02:01:48 +0000 | [diff] [blame] | 9 | @import cxx_decls.imported; |
| 10 | |
| 11 | void test_delete(int *p) { |
| 12 | // We can call the normal global deallocation function even though it has only |
| 13 | // ever been explicitly declared in an unimported submodule. |
| 14 | delete p; |
| 15 | } |
Richard Smith | 868edfa | 2013-08-30 00:23:29 +0000 | [diff] [blame] | 16 | |
| 17 | void friend_1(HasFriends s) { |
| 18 | s.private_thing(); |
| 19 | } |
| 20 | void test_friends(HasFriends s) { |
| 21 | friend_1(s); |
| 22 | friend_2(s); |
| 23 | } |
Stephen Hines | 6bcf27b | 2014-05-29 04:14:42 -0700 | [diff] [blame^] | 24 | |
| 25 | static_assert(!__is_trivial(HasNontrivialDefaultConstructor), ""); |
| 26 | static_assert(!__has_trivial_constructor(HasNontrivialDefaultConstructor), ""); |
| 27 | |
| 28 | void use_implicit_new_again() { operator new[](3); } |