diff options
author | Fariborz Jahanian <fjahanian@apple.com> | 2010-04-26 22:07:03 +0000 |
---|---|---|
committer | Fariborz Jahanian <fjahanian@apple.com> | 2010-04-26 22:07:03 +0000 |
commit | 0b7bc8e937735e2b3608c049752c4aa48a283d2a (patch) | |
tree | b437624ad91258ca2d6e49eb38d46e1dafa853d8 /lib | |
parent | bc0b915148688033e37e9175ddf7629333e45d43 (diff) |
Diagnose declaration of reference typed ivars.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102390 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Sema/SemaDecl.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp index 20e4200fbe..3f309bb6ad 100644 --- a/lib/Sema/SemaDecl.cpp +++ b/lib/Sema/SemaDecl.cpp @@ -5875,10 +5875,13 @@ Sema::DeclPtrTy Sema::ActOnIvar(Scope *S, // validate II. } - + if (T->isReferenceType()) { + Diag(Loc, diag::err_ivar_reference_type); + D.setInvalidType(); + } // C99 6.7.2.1p8: A member of a structure or union may have any type other // than a variably modified type. - if (T->isVariablyModifiedType()) { + else if (T->isVariablyModifiedType()) { Diag(Loc, diag::err_typecheck_ivar_variable_size); D.setInvalidType(); } |