]> granicus.if.org Git - clang/commitdiff
[PS4] Undo dialect tweak for Objective-C.
authorPaul Robinson <paul.robinson@sony.com>
Wed, 14 Dec 2016 02:06:11 +0000 (02:06 +0000)
committerPaul Robinson <paul.robinson@sony.com>
Wed, 14 Dec 2016 02:06:11 +0000 (02:06 +0000)
In r267772, we had set the PS4's default dialect for both C and
Objective-C to gnu99.  Make that change only for C; we don't really
support Objective-C/C++ so there's no point fiddling the dialect.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@289625 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Frontend/CompilerInvocation.cpp
test/SemaObjC/objcbridge-attribute-arc.m

index e243cf2e356cf5d63c2631e8fa1d3e2ad4ad5c89..989feef6c51de2593c26afb4d8800cba2a714fa3 100644 (file)
@@ -1558,14 +1558,16 @@ void CompilerInvocation::setLangDefaults(LangOptions &Opts, InputKind IK,
     case IK_Asm:
     case IK_C:
     case IK_PreprocessedC:
-    case IK_ObjC:
-    case IK_PreprocessedObjC:
       // The PS4 uses C99 as the default C standard.
       if (T.isPS4())
         LangStd = LangStandard::lang_gnu99;
       else
         LangStd = LangStandard::lang_gnu11;
       break;
+    case IK_ObjC:
+    case IK_PreprocessedObjC:
+      LangStd = LangStandard::lang_gnu11;
+      break;
     case IK_CXX:
     case IK_PreprocessedCXX:
     case IK_ObjCXX:
index 26dbce09b8164f7d1a5c9095949b93eec9cf2dda..3bcfdf48e79466bd94a4b1d7a45764ef0b30cf13 100644 (file)
@@ -23,10 +23,7 @@ typedef struct __CFSetRef * CFSetRef __attribute__((objc_bridge(NSSet))); // exp
 
 typedef union __CFUColor __attribute__((objc_bridge(NSUColor))) * CFUColorRef; // expected-error {{parameter of 'objc_bridge' attribute must be 'id' when used on a typedef}}
 
-// This error requires C11.
-#if __STDC_VERSION__ > 199901L
-typedef union __CFUColor __attribute__((objc_bridge(NSUColor))) * CFUColorRef; // expected-error {{parameter of 'objc_bridge' attribute must be 'id' when used on a typedef}}\r
-#endif
+typedef union __CFUColor __attribute__((objc_bridge(NSUColor))) * CFUColorRef; // expected-error {{parameter of 'objc_bridge' attribute must be 'id' when used on a typedef}}
 
 typedef union __CFUColor __attribute__((objc_bridge(NSUColor))) *CFUColor1Ref; // expected-error {{parameter of 'objc_bridge' attribute must be 'id' when used on a typedef}}