diff options
author | dim <dim@FreeBSD.org> | 2013-04-08 18:45:10 +0000 |
---|---|---|
committer | dim <dim@FreeBSD.org> | 2013-04-08 18:45:10 +0000 |
commit | c72c57c9e9b69944e3e009cd5e209634839581d3 (patch) | |
tree | 4fc2f184c499d106f29a386c452b49e5197bf63d /test/SemaCXX/atomic-type.cxx | |
parent | 5b20025c30d23d521e12c1f33ec8fa6b821952cd (diff) | |
download | FreeBSD-src-c72c57c9e9b69944e3e009cd5e209634839581d3.zip FreeBSD-src-c72c57c9e9b69944e3e009cd5e209634839581d3.tar.gz |
Vendor import of clang trunk r178860:
http://llvm.org/svn/llvm-project/cfe/trunk@178860
Diffstat (limited to 'test/SemaCXX/atomic-type.cxx')
-rw-r--r-- | test/SemaCXX/atomic-type.cxx | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/test/SemaCXX/atomic-type.cxx b/test/SemaCXX/atomic-type.cxx index 18707eb..947bb3c 100644 --- a/test/SemaCXX/atomic-type.cxx +++ b/test/SemaCXX/atomic-type.cxx @@ -1,7 +1,9 @@ -// RUN: %clang_cc1 -verify %s +// RUN: %clang_cc1 -verify -pedantic %s template<typename T> struct atomic { _Atomic(T) value; + + void f() _Atomic; // expected-error {{expected ';' at end of declaration list}} }; template<typename T> struct user { @@ -15,9 +17,11 @@ user<int> u; struct A { }; int &ovl1(_Atomic(int)); +int &ovl1(_Atomic int); // ok, redeclaration long &ovl1(_Atomic(long)); float &ovl1(_Atomic(float)); double &ovl1(_Atomic(A const *const *)); +double &ovl1(A const *const *_Atomic); short &ovl1(_Atomic(A **)); void test_overloading(int i, float f, _Atomic(int) ai, _Atomic(float) af, @@ -33,3 +37,22 @@ void test_overloading(int i, float f, _Atomic(int) ai, _Atomic(float) af, double &dr2 = ovl1(ac); short &sr1 = ovl1(a); } + +typedef int (A::*fp)() _Atomic; // expected-error {{expected ';' after top level declarator}} expected-warning {{does not declare anything}} + +typedef _Atomic(int(A::*)) atomic_mem_ptr_to_int; +typedef int(A::*_Atomic atomic_mem_ptr_to_int); + +typedef _Atomic(int)(A::*mem_ptr_to_atomic_int); +typedef _Atomic int(A::*mem_ptr_to_atomic_int); + +typedef _Atomic(int)&atomic_int_ref; +typedef _Atomic int &atomic_int_ref; +typedef _Atomic atomic_int_ref atomic_int_ref; // ok, qualifiers on references ignored in this case. + +typedef int &_Atomic atomic_reference_to_int; // expected-error {{'_Atomic' qualifier may not be applied to a reference}} +typedef _Atomic(int &) atomic_reference_to_int; // expected-error {{_Atomic cannot be applied to reference type 'int &'}} + +struct S { + _Atomic union { int n; }; // expected-warning {{anonymous union cannot be '_Atomic'}} +}; |