[cfe-commits] r150702 - /cfe/trunk/lib/Sema/SemaDeclAttr.cpp

Douglas Gregor dgregor at apple.com
Thu Feb 16 12:42:33 PST 2012


On Feb 16, 2012, at 9:15 AM, DeLesley Hutchins <delesley at google.com> wrote:

> Author: delesley
> Date: Thu Feb 16 11:15:51 2012
> New Revision: 150702
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=150702&view=rev
> Log:
> Thread safety analysis: Don't check for lockable on undefined types.
> 
> Modified:
>    cfe/trunk/lib/Sema/SemaDeclAttr.cpp
> 
> Modified: cfe/trunk/lib/Sema/SemaDeclAttr.cpp
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDeclAttr.cpp?rev=150702&r1=150701&r2=150702&view=diff
> ==============================================================================
> --- cfe/trunk/lib/Sema/SemaDeclAttr.cpp (original)
> +++ cfe/trunk/lib/Sema/SemaDeclAttr.cpp Thu Feb 16 11:15:51 2012
> @@ -283,6 +283,9 @@
>       << Attr.getName();
>     return false;
>   }
> +  // Don't check for lockable if the class hasn't been defined yet. 
> +  if (RT->isIncompleteType())
> +    return true;
>   // Flag error if the type is not lockable.
>   if (!RT->getDecl()->getAttr<LockableAttr>()) {
>     S.Diag(Attr.getLoc(), diag::err_attribute_argument_not_lockable)


Do you want to use RequireCompleteType, to instantiate class templates or member classes of class templates if needed? 

	- Doug



More information about the cfe-commits mailing list