[cfe-commits] r166030 - in /cfe/trunk: lib/Sema/SemaExpr.cpp test/SemaObjC/crash-on-objc-bool-literal.m

David Blaikie dblaikie at gmail.com
Tue Oct 16 10:41:10 PDT 2012


On Tue, Oct 16, 2012 at 10:08 AM, Fariborz Jahanian <fjahanian at apple.com> wrote:
> Author: fjahanian
> Date: Tue Oct 16 12:08:11 2012
> New Revision: 166030
>
> URL: http://llvm.org/viewvc/llvm-project?rev=166030&view=rev
> Log:
> Minor tweak to last patch along with a test case.
> // rdar://12491143
>
> Added:
>     cfe/trunk/test/SemaObjC/crash-on-objc-bool-literal.m
> Modified:
>     cfe/trunk/lib/Sema/SemaExpr.cpp
>
> Modified: cfe/trunk/lib/Sema/SemaExpr.cpp
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaExpr.cpp?rev=166030&r1=166029&r2=166030&view=diff
> ==============================================================================
> --- cfe/trunk/lib/Sema/SemaExpr.cpp (original)
> +++ cfe/trunk/lib/Sema/SemaExpr.cpp Tue Oct 16 12:08:11 2012
> @@ -11915,7 +11915,7 @@
>           "Unknown Objective-C Boolean value!");
>    QualType BoolT = Context.ObjCBuiltinBoolTy;
>    if (!Context.getBOOLDecl()) {
> -    LookupResult Result(*this, &Context.Idents.get("BOOL"), SourceLocation(),
> +    LookupResult Result(*this, &Context.Idents.get("BOOL"), OpLoc,
>                          Sema::LookupOrdinaryName);
>      if (LookupName(Result, getCurScope()) && Result.isSingleResult()) {
>        NamedDecl *ND = Result.getFoundDecl();
>
> Added: cfe/trunk/test/SemaObjC/crash-on-objc-bool-literal.m
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaObjC/crash-on-objc-bool-literal.m?rev=166030&view=auto
> ==============================================================================
> --- cfe/trunk/test/SemaObjC/crash-on-objc-bool-literal.m (added)
> +++ cfe/trunk/test/SemaObjC/crash-on-objc-bool-literal.m Tue Oct 16 12:08:11 2012

Idle comment: where possible it's nice to add test cases to existing
test files to keep the number of separate process invocations down as
(I'm told) this is a significant determiner in regression suite
execution time.

> @@ -0,0 +1,12 @@
> +// RUN: %clang_cc1  -fsyntax-only -verify %s
> +// RUN: %clang_cc1 -x objective-c++ -fsyntax-only -verify %s
> +// rdar://12456743
> +
> +typedef signed char BOOL; // expected-note 2 {{candidate found by name lookup is 'BOOL'}}
> +
> +EXPORT BOOL FUNC(BOOL enabled); // expected-error {{unknown type name 'EXPORT'}} // expected-error {{expected ';' after top level declarator}} \
> +                                // expected-note 2 {{candidate found by name lookup is 'BOOL'}}
> +
> +static inline BOOL MFIsPrivateVersion(void) { // expected-error {{reference to 'BOOL' is ambiguous}}
> + return __objc_yes; // expected-error {{reference to 'BOOL' is ambiguous}}
> +}
>
>
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits



More information about the cfe-commits mailing list