[cfe-commits] r130641 - /cfe/trunk/lib/Sema/SemaExprCXX.cpp

Douglas Gregor dgregor at apple.com
Sun May 1 08:34:59 PDT 2011


On Apr 30, 2011, at 11:51 PM, Chandler Carruth wrote:

> Author: chandlerc
> Date: Sun May  1 01:51:22 2011
> New Revision: 130641
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=130641&view=rev
> Log:
> More cleanup of the type traits implementation.
> 1) Moved the completeness checking routine above the evaluation routine
>   so the reader sees that we do in fact check for complete types when
>   necessary.
> 2) Remove the FIXME comment about not doing this.
> 3) Make the arguments to the evaluate function agree in order with those
>   to the completeness checking function.
> 4) Completely specify the enumerators for the completeness checking
>   function rather than relying on a default.
> 5) Remove a check for the Borland language to only require complete
>   types in a few places. Borland's own documentation doesn't agree with
>   this: some of the previously unspecified traits *do* require
>   a complete type, some don't.
> 6) Correctly split the traits which do not require complete types from
>   those that do, clarifying comments and citations to the standard or
>   other documentation where relevant.

I like this cleanup quite a bit.

> +    // C++0x [meta.unary.prop] Table 49 requires the following traits to be
> +    // applied to a complete type, so we enumerate theme here even though the
> +    // default for non-Borland compilers is to require completeness for any
> +    // other traits than the ones specifically allowed to work on incomplete
> +    // types.

We have "Borland" here and "Embarcadero" below... I don't particularly care which we use, but we should be consistent at least within a function :)

> +  case UTT_IsTrivial:
> +  case UTT_IsStandardLayout:
> +  case UTT_IsPOD:
> +  case UTT_IsLiteral:
> +  case UTT_IsEmpty:
> +  case UTT_IsPolymorphic:
> +  case UTT_IsAbstract:
> +    // Fallthrough
> +
> +    // These trait expressions are designed to help implement predicats in

Typo "predicats".

	- Doug




More information about the cfe-commits mailing list