Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(13)

Side by Side Diff: gcc/gcc/testsuite/gfortran.dg/structure_constructor_8.f03

Issue 3050029: [gcc] GCC 4.5.0=>4.5.1 (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/nacl-toolchain.git
Patch Set: Created 10 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 ! { dg-do compile } 1 ! { dg-do compile }
2 ! Test for errors when setting private components inside a structure constructor 2 ! Test for errors when setting private components inside a structure constructor
3 ! or when constructing a private structure. 3 ! or when constructing a private structure.
4 4
5 MODULE privmod 5 MODULE privmod
6 IMPLICIT NONE 6 IMPLICIT NONE
7 7
8 TYPE :: haspriv_t 8 TYPE :: haspriv_t
9 INTEGER :: a 9 INTEGER :: a
10 INTEGER, PRIVATE :: b = 42 10 INTEGER, PRIVATE :: b = 42
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 44
45 ! This should succeed, not giving value to private component 45 ! This should succeed, not giving value to private component
46 struct1 = haspriv_t (5) 46 struct1 = haspriv_t (5)
47 struct2 = allpriv_t () 47 struct2 = allpriv_t ()
48 48
49 ! These should fail 49 ! These should fail
50 struct1 = haspriv_t (1, 2) ! { dg-error "is a PRIVATE component" } 50 struct1 = haspriv_t (1, 2) ! { dg-error "is a PRIVATE component" }
51 struct1 = haspriv_t (b = 2, a = 1) ! { dg-error "is a PRIVATE component" } 51 struct1 = haspriv_t (b = 2, a = 1) ! { dg-error "is a PRIVATE component" }
52 52
53 ! This should fail as all components are private 53 ! This should fail as all components are private
54 struct2 = allpriv_t (5) ! { dg-error "of 'allpriv_t' are PRIVATE" } 54 struct2 = allpriv_t (5) ! { dg-error "is a PRIVATE component" }
55 55
56 ! This should fail as the type itself is private, and the expression should 56 ! This should fail as the type itself is private, and the expression should
57 ! be deduced as call to an undefined function. 57 ! be deduced as call to an undefined function.
58 WRITE (*,*) ispriv_t (5) ! { dg-error "has no IMPLICIT type" } 58 WRITE (*,*) ispriv_t (5) ! { dg-error "has no IMPLICIT type" }
59 59
60 END PROGRAM test 60 END PROGRAM test
61 ! { dg-final { cleanup-modules "privmod" } } 61 ! { dg-final { cleanup-modules "privmod" } }
OLDNEW
« no previous file with comments | « gcc/gcc/testsuite/gfortran.dg/streamio_2.f90 ('k') | gcc/gcc/testsuite/gfortran.dg/substr_6.f90 » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698