[cfe-commits] r166030 - in /cfe/trunk: lib/Sema/SemaExpr.cpp test/SemaObjC/crash-on-objc-bool-literal.m
Fariborz Jahanian
fjahanian at apple.com
Tue Oct 16 10:08:11 PDT 2012
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
@@ -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}}
+}
More information about the cfe-commits
mailing list