// RUN: %clang_cc1 -emit-pch -o %t.1.ast %S/Inputs/exprs1.c
// RUN: %clang_cc1 -emit-pch -o %t.2.ast %S/Inputs/exprs2.c
// RUN: %clang_cc1 -ast-merge %t.1.ast -ast-merge %t.2.ast -fsyntax-only -verify %s
+// expected-no-diagnostics
// RUN: %clang_cc1 -analyze -analyzer-checker=osx.coreFoundation.containers.PointerSizedValues -triple x86_64-apple-darwin -verify %s
+// expected-no-diagnostics
typedef const struct __CFAllocator * CFAllocatorRef;
typedef const struct __CFArray * CFArrayRef;
// RUN: %clang_cc1 -analyze -analyzer-checker=core,osx.cocoa.RetainCount,alpha.core -verify %s -analyzer-constraints=range -analyzer-store=region
+// expected-no-diagnostics
typedef struct objc_selector *SEL;
typedef signed char BOOL;
// RUN: %clang_cc1 -analyze -analyzer-checker=alpha.osx.cocoa.Dealloc %s -verify
+// expected-no-diagnostics
typedef signed char BOOL;
@protocol NSObject
- (BOOL)isEqual:(id)object;
// RUN: %clang_cc1 -analyze -analyzer-checker=core,osx.cocoa.RetainCount,alpha.core -analyzer-store=region -analyzer-constraints=range -verify -Wno-objc-root-class %s
+// expected-no-diagnostics
// BEGIN delta-debugging reduced header stuff
// RUN: %clang_cc1 -analyze -analyzer-checker=core,alpha.core -analyzer-store=region -analyzer-constraints=range -verify %s
+// expected-no-diagnostics
#include <stdarg.h>
// RUN: %clang_cc1 -triple x86_64-apple-darwin9 -analyze -analyzer-checker=core,osx -analyzer-store=region -verify -fblocks -analyzer-opt-analyze-nested-blocks %s
+// expected-no-diagnostics
// Test handling of OSAtomicCompareAndSwap when C++ inserts "no-op" casts and we
// do a forced load and binding to the environment on an expression that would regularly
// RUN: %clang_cc1 -analyze -analyzer-checker=core,alpha.core -analyzer-store=region -analyzer-constraints=range -Wno-objc-root-class %s -verify
+// expected-no-diagnostics
// The point of this test cases is to exercise properties in the static
// analyzer
// RUN: %clang_cc1 -cc1 -std=c++11 -Wuninitialized -verify %s
+// expected-no-diagnostics
void f() {
int a[] = { 1, 2, 3 };
// RUN: %clang_cc1 -triple x86_64-apple-darwin9 -analyze -analyzer-checker=core,alpha.core -analyzer-store=region -verify %s
// RUN: %clang_cc1 -triple i386-apple-darwin9 -analyze -analyzer-checker=core,alpha.core -analyzer-store=region -verify %s
+// expected-no-diagnostics
// Test if the 'storage' region gets properly initialized after it is cast to
// 'struct sockaddr *'.
// RUN: %clang_cc1 -analyze -analyzer-checker=core,alpha.core -analyzer-store=region -verify %s
+// expected-no-diagnostics
// Test function pointer casts. Currently we track function addresses using
// loc::FunctionVal. Because casts can be arbitrary, do we need to model
// RUN: %clang_cc1 -analyze -analyzer-checker=core,osx.cocoa.RetainCount,alpha.core -analyzer-store=region -analyzer-constraints=range -verify %s
+// expected-no-diagnostics
typedef unsigned char Boolean;
typedef signed long CFIndex;
// RUN: %clang_cc1 -analyze -analyzer-checker=core,alpha.core -analyzer-store=region -analyzer-constraints=range -verify %s
+// expected-no-diagnostics
// This test case was reported in <rdar:problem/6080742>.
// It tests path-sensitivity with respect to '!(cfstring != 0)' (negation of inequality).
// RUN: %clang_cc1 -analyze -analyzer-checker=core -analyzer-output=text -verify %s
+// expected-no-diagnostics
// Do not crash on initialization to complex numbers.
void init_complex() {
// RUN: %clang_cc1 -analyze -analyzer-checker=core,alpha.core -analyzer-store=region -verify %s
+// expected-no-diagnostics
void foo() {
int *p = (int*) 0x10000; // Should not crash here.
// RUN: %clang_cc1 -analyze -analyzer-checker=unix.cstring.BadSizeArg -analyzer-store=region -verify %s
+// expected-no-diagnostics
// Ensure we don't crash on C++ declarations with special names.
struct X {
// RUN: %clang_cc1 -analyze -analyzer-checker=core,unix,osx,alpha.unix,alpha.security.taint -analyzer-store region -verify %s
+// expected-no-diagnostics
class Evil {
public:
// RUN: %clang_cc1 -analyze -analyzer-checker=core -std=c++11 -verify %s
+// expected-no-diagnostics
// radar://11485149, PR12871
class PlotPoint {
// RUN: %clang_cc1 -analyze -analyzer-checker=alpha.core -analyzer-checker=deadcode.DeadStores,osx.cocoa.RetainCount -fblocks -verify -Wno-objc-root-class %s
+// expected-no-diagnostics
typedef signed char BOOL;
typedef unsigned int NSUInteger;
// RUN: %clang_cc1 -analyze -analyzer-checker=core,osx.cocoa.RetainCount -analyzer-store=region -Wno-objc-root-class -verify %s
+// expected-no-diagnostics
//===----------------------------------------------------------------------===//
// RUN: %clang_cc1 -analyze -analyzer-checker=core,unix.Malloc -verify %s
+// expected-no-diagnostics
typedef struct {
char I[4];
// RUN: %clang_cc1 -analyze -analyzer-store=region -analyzer-constraints=range -fblocks -analyzer-opt-analyze-nested-blocks -analyzer-checker=alpha.deadcode.IdempotentOperations,osx.cocoa.RetainCount -verify %s
+// expected-no-diagnostics
typedef signed char BOOL;
typedef unsigned long NSUInteger;
// RUN: %clang_cc1 -analyze -analyzer-checker=core -verify %s
+// expected-no-diagnostics
// Test parameter 'a' is registered to LiveVariables analysis data although it
// is not referenced in the function body.
// RUN: %clang_cc1 -analyze -analyzer-checker=core -verify %s
+// expected-no-diagnostics
// Test when entering f1(), we set the right AnalysisDeclContext to Environment.
// Otherwise, block-level expr '1 && a' would not be block-level.
// RUN: %clang_cc1 -analyze -analyzer-checker=core -verify %s
+// expected-no-diagnostics
int g(int a) {
return a;
// RUN: %clang_cc1 -analyze -analyzer-checker=core -analyzer-ipa=dynamic-bifurcate -analyzer-config objc-inlining=false -verify %s
+// expected-no-diagnostics
typedef signed char BOOL;
typedef struct objc_class *Class;
// RUN: %clang_cc1 -analyze -analyzer-checker=core -analyzer-store=region -verify %s
+// expected-no-diagnostics
int f1() {
int x = 0, y = 1;
// RUN: %clang_cc1 -analyze -analyzer-checker=alpha.security.MallocOverflow -verify %s
+// expected-no-diagnostics
class A {
public:
// RUN: %clang_cc1 -analyze -analyzer-checker=core -analyzer-store region -verify %s
+// expected-no-diagnostics
// Intra-procedural C++ tests.
// RUN: %clang_cc1 -triple x86_64-apple-darwin9 -analyze -analyzer-checker=core,alpha.core -analyzer-store=region -analyzer-constraints=range -verify -fblocks %s
+// expected-no-diagnostics
// <rdar://problem/6440393> - A bunch of misc. failures involving evaluating
// these expressions and building CFGs. These tests are here to prevent
// RUN: %clang_cc1 -triple thumbv7-apple-ios0.0.0 -analyze -analyzer-checker=core -analyzer-store=region -verify -fblocks -analyzer-opt-analyze-nested-blocks -Wno-objc-root-class %s
+// expected-no-diagnostics
// <rdar://problem/11405978> - Handle casts of vectors to structs, and loading
// a value.
// RUN: %clang_cc1 -analyze -analyzer-checker=core,alpha.core -analyzer-store=region -analyzer-constraints=range -verify -fblocks %s -analyzer-eagerly-assume
+// expected-no-diagnostics
// Delta-reduced header stuff (needed for test cases).
typedef signed char BOOL;
// RUN: %clang_cc1 -triple i386-apple-darwin9 -analyze -analyzer-checker=core,alpha.core -analyzer-store=region -verify -fblocks %s
+// expected-no-diagnostics
// Here is a case where a pointer is treated as integer, invalidated as an
// integer, and then used again as a pointer. This test just makes sure
// RUN: %clang_cc1 -triple x86_64-apple-darwin9 -analyze -analyzer-checker=core,alpha.core -analyzer-store=region -verify -fblocks %s
+// expected-no-diagnostics
// Here is a case where a pointer is treated as integer, invalidated as an
// integer, and then used again as a pointer. This test just makes sure
// RUN: %clang_cc1 -triple i386-apple-darwin9 -analyze -analyzer-checker=core,alpha.core -analyzer-store=region -verify -fblocks -analyzer-opt-analyze-nested-blocks %s
// RUN: %clang_cc1 -triple x86_64-apple-darwin9 -analyze -analyzer-checker=core,alpha.core -analyzer-store=region -verify -fblocks -analyzer-opt-analyze-nested-blocks %s
+// expected-no-diagnostics
//===------------------------------------------------------------------------------------------===//
// This files tests our path-sensitive handling of Objective-c++ files.
// RUN: %clang_cc1 -analyze -analyzer-checker=core,alpha.core -analyzer-store=region -verify %s
+// expected-no-diagnostics
// This is a test case for the issue reported in PR 2819:
// http://llvm.org/bugs/show_bug.cgi?id=2819
// RUN: %clang_cc1 -analyze -analyzer-checker=core,alpha.core -std=gnu99 -analyzer-store=region -verify %s
+// expected-no-diagnostics
// The store for 'a[1]' should not be removed mistakenly. SymbolicRegions may
// RUN: %clang --analyze %s -o %t -Xclang -verify
+// expected-no-diagnostics
// Test handling of ObjC bool literals.
// RUN: %clang_cc1 -triple x86_64-apple-darwin9 -analyze -analyzer-checker=core,alpha.core -analyzer-store=region -verify %s
+// expected-no-diagnostics
// PR 4164: http://llvm.org/bugs/show_bug.cgi?id=4164
//
// RUN: %clang_cc1 -analyze -analyzer-checker=core,alpha.core %s -analyzer-store=region -verify
+// expected-no-diagnostics
typedef int bar_return_t;
typedef struct {
// RUN: %clang_cc1 -analyze -analyzer-checker=core,osx.cocoa.RetainCount,alpha.core -analyzer-constraints=range -analyzer-store=region -verify %s
+// expected-no-diagnostics
//
// This test case mainly checks that the retain/release checker doesn't crash
// on this file.
// RUN: %clang_cc1 -analyze -analyzer-checker=core,alpha.core -analyzer-constraints=range -analyzer-store=region -verify -Wno-objc-root-class %s
+// expected-no-diagnostics
typedef struct Foo { int x; } Bar;
// RUN: %clang_cc1 -analyze -analyzer-checker=unix,core,alpha.security.taint -w -verify %s
+// expected-no-diagnostics
// Make sure we don't crash when someone redefines a system function we reason about.
// RUN: %clang_cc1 -analyze -analyzer-checker=core,alpha.core -analyzer-store=region -verify %s
+// expected-no-diagnostics
//
// This test case simply should not crash. It evaluates the logic of not
// using MemRegion::getRValueType in incorrect places.
// RUN: %clang_cc1 -analyze -analyzer-checker=core,unix -verify %s
+// expected-no-diagnostics
int printf(const char *restrict,...);
// RUN: %clang_cc1 -triple i686-pc-linux-gnu -analyze -analyzer-checker=security.insecureAPI,security.FloatLoopCounter %s -verify
+// expected-no-diagnostics
// This file complements 'security-syntax-checks.m', but tests that we omit
// specific checks on platforms where they don't make sense.
// RUN: %clang_cc1 -analyze -analyzer-checker=core -verify -Wno-objc-root-class %s
+// expected-no-diagnostics
// Test reasoning about static locals in ObjCMethods.
int *getValidPtr();
// RUN: %clang_cc1 -analyze -analyzer-checker=core,unix -verify %s
+// expected-no-diagnostics
// Testing core functionality of the SValBuilder.
// RUN: %clang_cc1 -analyze -analyzer-checker=alpha.security.taint,debug.TaintTest %s -verify
+// expected-no-diagnostics
typedef struct _FILE FILE;
typedef __typeof(sizeof(int)) size_t;
// RUN: %clang_cc1 -analyze -analyzer-checker=alpha.security.taint,debug.TaintTest %s -verify
+// expected-no-diagnostics
#import <stdarg.h>
// RUN: %clang_cc1 -analyze -analyzer-checker=core -analyzer-store=region -verify %s
+// expected-no-diagnostics
typedef unsigned int NSUInteger;
// RUN: %clang_cc1 -analyze -analyzer-checker=core -analyzer-store=region -analyzer-constraints=range %s -verify
+// expected-no-diagnostics
//===-- unions-region.m ---------------------------------------------------===//
//
// RUN: %clang_cc1 -analyze -analyzer-checker=core %s -verify
+// expected-no-diagnostics
namespace PR14054_reduced {
struct Definition;
// RUN: %clang_cc1 -fsyntax-only -verify %s
+// expected-no-diagnostics
namespace N1 {
struct X { };
// RUN: %clang_cc1 -fsyntax-only -verify %s
+// expected-no-diagnostics
// C++0x [basic.lookup.classref]p3:
// If the unqualified-id is ~type-name, the type-name is looked up in the
// RUN: %clang_cc1 -std=c++11 %s -verify
+// expected-no-diagnostics
struct A { void f(); };
struct C { void f(); };
// RUN: %clang_cc1 -fsyntax-only -verify %s
+// expected-no-diagnostics
// This is basically paraphrased from the standard.
// RUN: %clang_cc1 -fsyntax-only -verify %s
+// expected-no-diagnostics
namespace A {
int a;
// RUN: %clang_cc1 -fsyntax-only -verify %s
+// expected-no-diagnostics
// When looking up a namespace-name in a using-directive or
// namespace-alias-definition, only namespace names are considered.
// RUN: %clang_cc1 -fsyntax-only -verify %s
+// expected-no-diagnostics
struct S {};
S E0;
// RUN: %clang_cc1 -fsyntax-only -verify %s
+// expected-no-diagnostics
struct S {
static const int f0 = 0;
// RUN: %clang_cc1 -fsyntax-only -verify %s
+// expected-no-diagnostics
// C++0x [basic.lookup.unqual]p14:
// If a variable member of a namespace is defined outside of the
// RUN: %clang_cc1 -fsyntax-only -verify %s
+// expected-no-diagnostics
typedef int f;
// RUN: %clang_cc1 -fsyntax-only -verify %s
+// expected-no-diagnostics
// Template type parameters.
typedef unsigned char T;
// RUN: %clang_cc1 -fsyntax-only -verify %s
+// expected-no-diagnostics
typedef int Int;
typedef char Char;
// RUN: %clang_cc1 -fsyntax-only -verify %s
+// expected-no-diagnostics
typedef int Int;
typedef char Char;
// RUN: %clang_cc1 -fsyntax-only -verify %s
+// expected-no-diagnostics
int main() {
}
// RUN: %clang_cc1 -fsyntax-only -verify %s
+// expected-no-diagnostics
int main(int argc, const char* const* argv) {
}
// RUN: %clang_cc1 -fsyntax-only -verify %s
+// expected-no-diagnostics
int *use_new(int N) {
return new int [N];
// RUN: %clang_cc1 -fsyntax-only -verify %s
+// expected-no-diagnostics
namespace std {
class bad_alloc { };
// RUN: %clang_cc1 -fsyntax-only -verify %s
+// expected-no-diagnostics
// PR12497
namespace test0 {
// RUN: %clang_cc1 %s -fsyntax-only -verify
+// expected-no-diagnostics
// "During the lookup for a base class name, non-type names are ignored"
namespace PR5840 {
// RUN: %clang_cc1 -fsyntax-only -verify %s
+// expected-no-diagnostics
// Make sure that friend declarations don't introduce ambiguous
// declarations.
// RUN: %clang_cc1 -fsyntax-only -verify -std=c++11 %s
+// expected-no-diagnostics
class A {
class AInner {
// RUN: %clang_cc1 -fsyntax-only -verify %s
+// expected-no-diagnostics
// C++0x [class.nest] p3:
// If class X is defined in a namespace scope, a nested class Y may be
// RUN: %clang_cc1 -fsyntax-only -verify %s -std=c++11
+// expected-no-diagnostics
namespace Test1 {
class A final { };
// RUN: %clang_cc1 -fsyntax-only -verify %s -std=c++11
+// expected-no-diagnostics
class Trivial { int n; void f(); };
class NonTrivial1 { NonTrivial1(const NonTrivial1 &); };
// RUN: %clang_cc1 -fsyntax-only -verify -std=c++0x -triple x86_64-pc-linux-gnu -ffreestanding %s
// RUN: %clang_cc1 -fsyntax-only -verify -std=c++0x -triple x86_64-pc-linux-gnu -ffreestanding -fshort-wchar %s
+// expected-no-diagnostics
#include <stdint.h>
// RUN: %clang_cc1 -fsyntax-only -verify -std=c++0x %s
+// expected-no-diagnostics
enum X : short { A, B };
extern decltype(+A) x;
// RUN: %clang_cc1 -fsyntax-only -verify %s
+// expected-no-diagnostics
namespace pr7801 {
extern void* x[];
// RUN: %clang_cc1 -fsyntax-only -verify %s
+// expected-no-diagnostics
bool is_char_ptr( const char* );
// RUN: %clang_cc1 -fsyntax-only -verify %s
+// expected-no-diagnostics
// PR8430
namespace N {
// RUN: %clang_cc1 -fsyntax-only -verify %s
+// expected-no-diagnostics
namespace test0 {
namespace ns0 {
// RUN: %clang_cc1 -fsyntax-only -verify %s
+// expected-no-diagnostics
// C++03 [namespace.udecl]p3:
// For the purpose of overload resolution, the functions which are
// RUN: %clang_cc1 -fsyntax-only -verify %s
+// expected-no-diagnostics
// <rdar://problem/8296180>
typedef int pid_t;
// RUN: %clang_cc1 -fsyntax-only -verify %s
+// expected-no-diagnostics
// PR5787
class C {
// RUN: %clang_cc1 -fsyntax-only -verify -std=c++11 %s
+// expected-no-diagnostics
int g(int);
void f() {
int i;
// RUN: %clang_cc1 -fsyntax-only -verify %s
+// expected-no-diagnostics
char x1[]("hello");
extern char x1[6];
// RUN: %clang_cc1 -fsyntax-only -verify %s
+// expected-no-diagnostics
void point(int = 3, int = 4);
// RUN: %clang_cc1 -std=c++11 -fsyntax-only -verify %s
+// expected-no-diagnostics
template<typename T> struct identity;
template<typename ...Types> struct tuple;
// RUN: %clang_cc1 -std=c++11 -fsyntax-only -verify %s
+// expected-no-diagnostics
template<typename T, typename U>
struct is_same {
// RUN: %clang_cc1 -fsyntax-only -verify %s
+// expected-no-diagnostics
namespace pr6200 {
struct v {};
// RUN: %clang_cc1 -std=c++11 -fsyntax-only -verify %s
+// expected-no-diagnostics
struct X {
void f() &;
// RUN: %clang_cc1 -fsyntax-only -verify -std=c++11 %s
+// expected-no-diagnostics
// PR10087: Make sure that we don't conflate exception specifications
// from different functions in the canonical type system.
// RUN: %clang_cc1 -std=c++11 -fexceptions -fcxx-exceptions -fsyntax-only -verify %s
+// expected-no-diagnostics
// This is the "let the user shoot himself in the foot" clause.
void f() noexcept {
// RUN: %clang_cc1 -std=c++11 -fsyntax-only -verify %s
+// expected-no-diagnostics
struct X { };
struct Y : X { };
// RUN: %clang_cc1 -fsyntax-only -std=c++11 -Wno-c++11-narrowing -verify %s
+// expected-no-diagnostics
// <rdar://problem/11121178>
void f(int x) {
// RUN: %clang_cc1 -std=c++11 -fsyntax-only -verify %s
+// expected-no-diagnostics
// The result of the expression const_cast<T>(v) is of type T. If T is
// an lvalue reference to object type, the result is an lvalue; if T
// RUN: %clang_cc1 -verify -fsyntax-only %s
+// expected-no-diagnostics
template<typename T> struct Node {
int lhs;
// RUN: %clang_cc1 -std=c++11 -fsyntax-only -verify %s
+// expected-no-diagnostics
// A glvalue of type "cv1 T1" can be cast to type "rvalue reference to
// cv2 T2" if "cv2 T2" is reference-compatible with "cv1 T1" (8.5.3).
// RUN: %clang_cc1 -std=c++11 -fsyntax-only -verify %s
+// expected-no-diagnostics
enum class EC { ec1 };
// RUN: %clang_cc1 -fsyntax-only -verify -std=c++11 %s
+// expected-no-diagnostics
struct foo {
foo();
// RUN: %clang_cc1 -fsyntax-only -std=c++11 %s -verify
+// expected-no-diagnostics
class NonCopyable {
NonCopyable(const NonCopyable&);
// RUN: %clang_cc1 -std=c++11 %s -Wunused -verify
+// expected-no-diagnostics
template<typename T, typename U>
struct is_same {
// RUN: %clang_cc1 -std=c++11 %s -Wunused -verify
+// expected-no-diagnostics
template<typename T>
void destroy(T* ptr) {
// RUN: %clang_cc1 -fsyntax-only -std=c++11 %s -verify
+// expected-no-diagnostics
struct DirectInitOnly {
explicit DirectInitOnly(DirectInitOnly&);
// RUN: %clang_cc1 -fcxx-exceptions -fexceptions -fsyntax-only -verify -std=c++11 -fms-extensions %s
+// expected-no-diagnostics
#define P(e) static_assert(noexcept(e), "expected nothrow")
#define N(e) static_assert(!noexcept(e), "expected throw")
// RUN: %clang_cc1 -fsyntax-only %s -verify
+// expected-no-diagnostics
namespace rdar10544564 {
// Check that we don't attempt to use an overloaded operator& when
// RUN: %clang_cc1 -fsyntax-only -verify %s
+// expected-no-diagnostics
int a0;
const volatile int a1 = 2;
// RUN: %clang_cc1 -fsyntax-only -verify %s
+// expected-no-diagnostics
// floating-point overloads
// RUN: %clang_cc1 -fsyntax-only -verify %s
// RUN: %clang_cc1 -std=c++11 -fsyntax-only -verify %s
+// expected-no-diagnostics
// Check types of char literals
extern char a;
// RUN: %clang_cc1 -fsyntax-only -trigraphs -Wtrigraphs -verify %s
+// expected-no-diagnostics
char a[] =
"?? ??\"??#??$??%??&??*??+??,??.??0??1??2??3??4??5??6"
// RUN: %clang_cc1 -fsyntax-only -std=c++11 -verify %s
+// expected-no-diagnostics
struct Variant {
template <typename T> operator T();
// RUN: %clang_cc1 -fsyntax-only -verify -std=c++11 %s
+// expected-no-diagnostics
enum class Color { Red, Green, Blue };
// RUN: %clang_cc1 -std=c++11 -fsyntax-only -verify %s
+// expected-no-diagnostics
namespace std_example {
int i;
int f1();
// RUN: %clang_cc1 -fsyntax-only -verify %s
+// expected-no-diagnostics
template<typename T> int &f0(T*, int);
float &f0(void*, int);
// RUN: %clang_cc1 -fsyntax-only -verify -std=c++11 %s
+// expected-no-diagnostics
// This is specifically testing the bullet:
// "do not have the same parameter-type-list as any non-template
// RUN: %clang_cc1 -std=c++11 -fsyntax-only -verify %s
+// expected-no-diagnostics
template<typename T> T &lvalue();
template<typename T> T &&xvalue();
// RUN: %clang_cc1 -std=c++11 %s -verify
+// expected-no-diagnostics
constexpr int operator "" _a(const char *c) {
return c[0];
// RUN: %clang_cc1 -std=c++11 %s -verify
+// expected-no-diagnostics
namespace PR13003 {
struct void_type
// RUN: %clang_cc1 -fsyntax-only -std=c++11 -verify %s
+// expected-no-diagnostics
namespace PR10622 {
struct foo {
// RUN: %clang_cc1 -std=c++11 %s -verify
+// expected-no-diagnostics
// C++98 [class.copy]p5 / C++11 [class.copy]p8.
// RUN: %clang_cc1 -fsyntax-only -verify %s
+// expected-no-diagnostics
struct X0 {
struct type { };
// RUN: %clang_cc1 -fsyntax-only -verify %s
+// expected-no-diagnostics
// PR5548
struct A {~A();};
// RUN: %clang_cc1 -std=c++11 %s -verify
+// expected-no-diagnostics
struct Value {
constexpr Value(int n) : n(n) {}
// RUN: %clang_cc1 -fsyntax-only -std=c++11 -verify %s
+// expected-no-diagnostics
// C++03 imposed restrictions in this paragraph that were lifted with 0x, so we
// just test that the example given now parses cleanly.
// RUN: %clang_cc1 -std=c++11 -fsyntax-only -verify %s
+// expected-no-diagnostics
template<typename T> using U = T;
// RUN: %clang_cc1 -fsyntax-only -verify %s
+// expected-no-diagnostics
// PR8905
template<char C1, char C2>
// RUN: %clang_cc1 -fsyntax-only -verify %s
+// expected-no-diagnostics
template<int I, int J, class T> struct X {
static const int value = 0;
};
// RUN: %clang_cc1 -fsyntax-only -verify %s
+// expected-no-diagnostics
template<typename T, int N>
struct A;
// RUN: %clang_cc1 -fsyntax-only -verify %s
+// expected-no-diagnostics
template<typename T> struct X1 { };
// RUN: %clang_cc1 -fsyntax-only -verify %s
+// expected-no-diagnostics
extern "C" void * malloc(int);
// RUN: %clang_cc1 -fsyntax-only -verify -std=c++11 %s
+// expected-no-diagnostics
// Core DR 532.
namespace PR8130 {
// RUN: %clang_cc1 -fsyntax-only -verify %s
+// expected-no-diagnostics
namespace DeduceVsMember {
template<typename T>
// RUN: %clang_cc1 -fsyntax-only -verify %s
+// expected-no-diagnostics
template<class T> int &f(T);
template<class T> float &f(T*, int=1);
// RUN: %clang_cc1 -fsyntax-only -verify %s
+// expected-no-diagnostics
// All of these function templates are distinct.
template<typename T> void f0(T) { }
// RUN: %clang_cc1 -fsyntax-only -verify %s
+// expected-no-diagnostics
namespace test0 {
template <class T> class A {
// RUN: %clang_cc1 -fsyntax-only -verify %s
+// expected-no-diagnostics
template <class T> struct A {
static T cond;
// RUN: %clang_cc1 -std=c++11 -fsyntax-only -verify %s
+// expected-no-diagnostics
namespace DeductionForInstantiation {
template<unsigned I, typename ...Types>
// RUN: %clang_cc1 -std=c++11 -fsyntax-only -verify %s
+// expected-no-diagnostics
// Example bind implementation from the variadic templates proposal,
// ISO C++ committee document number N2080.
// RUN: %clang_cc1 -std=c++11 -fsyntax-only -verify %s
+// expected-no-diagnostics
// Example function implementation from the variadic templates proposal,
// ISO C++ committee document number N2080.
// RUN: %clang_cc1 -std=c++11 -fsyntax-only -verify %s
+// expected-no-diagnostics
// Example tuple implementation from the variadic templates proposal,
// ISO C++ committee document number N2080.
// RUN: %clang_cc1 -std=c++11 -fsyntax-only -verify %s
+// expected-no-diagnostics
// Check for declaration matching with out-of-line declarations and
// variadic templates, which involves proper computation of the
// RUN: %clang_cc1 -std=c++11 -fsyntax-only -verify %s
+// expected-no-diagnostics
// Various tests related to partial ordering of variadic templates.
template<typename ...Types> struct tuple;
// RUN: %clang_cc1 -std=c++11 -fsyntax-only -verify %s
+// expected-no-diagnostics
namespace ParameterPacksWithFunctions {
template<typename ...> struct count;
// RUN: %clang_cc1 -std=c++11 -fsyntax-only -verify %s
+// expected-no-diagnostics
// Metafunction to extract the Nth type from a set of types.
template<unsigned N, typename ...Types> struct get_nth_type;
// RUN: %clang_cc1 -fsyntax-only -verify -std=c++11 %s
+// expected-no-diagnostics
#if !__has_feature(cxx_access_control_sfinae)
# error No support for access control as part of SFINAE?
// RUN: %clang_cc1 -verify %s
+// expected-no-diagnostics
typedef char one_byte;
struct two_bytes { char data[2]; };
// RUN: %clang_cc1 -fsyntax-only -verify %s
+// expected-no-diagnostics
template<typename T> struct A { };
// bullet 1
// RUN: %clang_cc1 -fsyntax-only -verify %s
+// expected-no-diagnostics
namespace PR8598 {
template<class T> struct identity { typedef T type; };
// RUN: %clang_cc1 -fsyntax-only -verify %s
+// expected-no-diagnostics
// FIXME: [temp.deduct.conv]p2 bullets 1 and 2 can't actually happen without
// references?
// RUN: %clang_cc1 -fsyntax-only -verify %s
+// expected-no-diagnostics
struct AnyPtr {
template<typename T>
operator T*() const;
// RUN: %clang_cc1 -std=c++11 -fsyntax-only -verify %s
+// expected-no-diagnostics
// Note: Partial ordering of function templates containing template
// parameter packs is independent of the number of deduced arguments
// RUN: %clang_cc1 -std=c++11 -fsyntax-only -verify %s
+// expected-no-diagnostics
template<typename T> int &f0(T&);
template<typename T> float &f0(T&&);
// RUN: %clang_cc1 -std=c++11 -fsyntax-only -verify %s
+// expected-no-diagnostics
template<typename T> void f(T&&);
template<> void f(int&) { }
void (*fp)(int&) = &f;
// RUN: %clang_cc1 -std=c++11 -fsyntax-only -verify %s
+// expected-no-diagnostics
// If type deduction cannot be done for any P/A pair, or if for any
// pair the deduction leads to more than one possible set of deduced
// RUN: %clang_cc1 -std=c++11 -fsyntax-only -verify %s
+// expected-no-diagnostics
// Note: Template argument deduction involving parameter packs
// (14.5.3) can deduce zero or more arguments for each parameter pack.
// RUN: %clang_cc1 -std=c++11 -fsyntax-only -verify %s
+// expected-no-diagnostics
// If the original function parameter associated with A is a function
// parameter pack and the function parameter associated with P is not
// RUN: %clang_cc1 -std=c++11 -fsyntax-only -verify %s
+// expected-no-diagnostics
// FIXME: More bullets to go!
// RUN: %clang_cc1 -std=c++11 -fsyntax-only -verify %s
+// expected-no-diagnostics
// Deductions specific to C++0x.
// RUN: %clang_cc1 -fsyntax-only -verify %s
+// expected-no-diagnostics
// Ensure that when enforcing access control an unqualified template name with
// explicit template arguments, we don't lose the context of the name lookup
// RUN: %clang_cc1 -fsyntax-only -verify %s
+// expected-no-diagnostics
struct meta {
template<typename U>
// RUN: %clang_cc1 -fsyntax-only -verify -std=c++11 %s
+// expected-no-diagnostics
template<typename> struct Y1;
template<typename, int> struct Y2;
// RUN: %clang_cc1 -fsyntax-only -verify %s
+// expected-no-diagnostics
template<typename> struct Y1;
template<typename, int> struct Y2;
// RUN: %clang_cc1 -fsyntax-only -verify %s
+// expected-no-diagnostics
// The scope of atemplate-parameterextends from its point of
// declaration until the end of its template. In particular, a
// RUN: %clang_cc1 -fsyntax-only -verify %s
+// expected-no-diagnostics
// There is no semantic difference between class and typename in a
// template-parameter. typename followed by an unqualified-id names a
// RUN: %clang_cc1 -verify %s -std=c++11
+// expected-no-diagnostics
template<const int I> struct S {
decltype(I) n;
// RUN: %clang_cc1 -fsyntax-only -verify %s
+// expected-no-diagnostics
template<int X[10]> struct A;
template<int *X> struct A;
template<int f(float, double)> struct B;
// RUN: %clang_cc1 -fsyntax-only -verify %s
+// expected-no-diagnostics
struct A0 {
struct K { };
};
// RUN: %clang_cc1 -std=c++11 -verify %s
+// expected-no-diagnostics
template<int n> struct S;
// RUN: %clang_cc1 -fsyntax-only -verify %s
+// expected-no-diagnostics
// C++0x [temp.local]p1:
// Like normal (non-template) classes, class templates have an
// RUN: %clang_cc1 -fsyntax-only -verify %s
+// expected-no-diagnostics
template<class T> struct A {
int B;
// RUN: %clang_cc1 -fsyntax-only -verify %s
+// expected-no-diagnostics
namespace N {
enum { C };
// RUN: %clang_cc1 -fsyntax-only -verify %s
+// expected-no-diagnostics
// This test creates cases where implicit instantiations of various entities
// would cause a diagnostic, but provides expliict specializations for those
// RUN: %clang_cc1 -fsyntax-only -verify %s
+// expected-no-diagnostics
template<class T> class Array { /* ... */ };
template<class T> void sort(Array<T>& v);
// RUN: %clang_cc1 -fsyntax-only -verify %s
+// expected-no-diagnostics
namespace N {
template<class T> class X { /* ... */ };
// RUN: %clang_cc1 -fsyntax-only -verify %s
+// expected-no-diagnostics
class X {
template <typename T> class Y {};
// RUN: %clang_cc1 -std=c++11 -verify %s
+// expected-no-diagnostics
// If the name declared in the explicit instantiation is an
// unqualified name, the explicit instantiation shall appear in the
// RUN: %clang_cc1 -fsyntax-only -verify %s
+// expected-no-diagnostics
template<class T> class Array { /* ... */ };
template<class T> void sort(Array<T>& v) { }
// RUN: %clang_cc1 %s -o %t -emit-llvm -verify
+// expected-no-diagnostics
// PR4289
struct funcptr {
// REQUIRES: arm-registered-target
// RUN: %clang_cc1 -target-abi aapcs -triple armv7-apple-darwin10 %s -verify
+// expected-no-diagnostics
#include <stddef.h>
// REQUIRES: arm-registered-target
// RUN: %clang_cc1 -target-abi apcs-gnu -triple armv7-apple-darwin10 %s -verify
+// expected-no-diagnostics
//
// Note: gcc forces the alignment to 4 bytes, regardless of the type of the
// zero length bitfield.
// RUN: %clang_cc1 -emit-llvm-only %s -verify
+// expected-no-diagnostics
// PR5882
int q_sk_num(void *a);
// RUN: %clang_cc1 -emit-llvm-only %s -verify
+// expected-no-diagnostics
// PR5730
struct A { operator int(); float y; };
// RUN: %clang_cc1 -emit-llvm-only -verify %s
+// expected-no-diagnostics
struct A {
A& operator=(A&);
// RUN: %clang_cc1 -emit-llvm-only -verify %s
+// expected-no-diagnostics
// PR7736
template <class scriptmemberptr> int InitMember(scriptmemberptr);
// RUN: %clang_cc1 -emit-llvm-only -verify %s
+// expected-no-diagnostics
enum A { a } __attribute((packed));
int func(A x) { return x==a; }
// RUN: %clang_cc1 %s -emit-llvm-only -verify
+// expected-no-diagnostics
// PR5489
template<typename E>
// RUN: %clang_cc1 %s -emit-llvm-only -verify
+// expected-no-diagnostics
struct F {
void (*x)();
// RUN: %clang_cc1 -emit-llvm-only -verify %s
+// expected-no-diagnostics
struct A { int a(); };
typedef int B;
// RUN: %clang_cc1 %s -emit-llvm-only -verify
+// expected-no-diagnostics
struct A {int a;};
struct B {float a;};
// RUN: %clang_cc1 %s -emit-llvm-only -verify
+// expected-no-diagnostics
union x {
int a;
// RUN: %clang_cc1 -emit-llvm-only -verify %s
+// expected-no-diagnostics
// PR5454
#include <stddef.h>
// RUN: %clang_cc1 %s -emit-llvm-only -verify
+// expected-no-diagnostics
struct A {};
struct B : A {};
// RUN: %clang_cc1 -emit-llvm-only -verify %s
+// expected-no-diagnostics
struct XPTParamDescriptor {};
struct nsXPTParamInfo {
// RUN: %clang_cc1 %s -emit-llvm -o - -std=c++11 -verify
+// expected-no-diagnostics
static_assert(true, "");
// RUN: %clang_cc1 -emit-llvm-only -verify %s
+// expected-no-diagnostics
// Make sure we don't crash generating y; its value is constant, but the
// initializer has side effects, so EmitConstantExpr should fail.
// RUN: %clang_cc1 %s -emit-llvm-only -verify -fcxx-exceptions -fexceptions
+// expected-no-diagnostics
// PR7281
class A {
// RUN: %clang_cc1 -fcxx-exceptions -fexceptions -emit-llvm-only -verify %s -Wno-unreachable-code
+// expected-no-diagnostics
int val = 42;
int& test1() {
// RUN: %clang_cc1 -emit-llvm-only -verify %s
+// expected-no-diagnostics
bool a() { return __is_pod(int); }
// RUN: %clang -Werror -fobjc-arc -fsyntax-only -fno-objc-arc -Xclang -verify %s
+// expected-no-diagnostics
// rdar://8949617
void * FOO() {
// RUN: %clang_cc1 -triple x86_64-unknown-nacl -std=c++11 -verify %s
+// expected-no-diagnostics
#include <stddef.h>
#include <stdarg.h>
// RUN: %clang -fsyntax-only -iframework %S/Inputs %s -Xclang -verify
+// expected-no-diagnostics
#include <TestFramework/TestFramework.h>
// RUN: %clang_cc1 -DA= -DB=1 -verify -fsyntax-only %s
+// expected-no-diagnostics
int a[(B A) == 1 ? 1 : -1];
// RUN: %clang_cc1 -Eonly -Wall -verify %s
// RUN: %clang_cc1 -E -dM -Wall -verify %s
+// expected-no-diagnostics
#pragma adgohweopihweotnwet
// Check that -w has higher priority than -Werror.
// RUN: %clang_cc1 -verify -Wsign-compare -Werror -w %s
+// expected-no-diagnostics
int f0(int x, unsigned y) {
return x < y;
// RUN: %clang_cc1 -verify -Wno-error=sign-compare %s
// RUN: %clang_cc1 -verify -Wsign-compare -w -Wno-error=sign-compare %s
+// expected-no-diagnostics
int f0(int x, unsigned y) {
return x < y;
// RUN: %clang -target i386-apple-darwin10 -fsyntax-only -Xclang -verify -std=c89 %s
+// expected-no-diagnostics
// FIXME: Disable inclusion of mm_malloc.h, our current implementation is broken
// on win32 since we don't generally know how to find errno.h.
// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -verify %s -ffreestanding
+// expected-no-diagnostics
#include <stdint.h>
typedef unsigned long long uint64_t;
// RUN: %clang_cc1 -fsyntax-only -verify %s
+// expected-no-diagnostics
// NULL is rdefined in stddef.h
#define NULL ((void*) 0)
// RUN: %clang_cc1 -ffreestanding -fsyntax-only -verify %s
// RUN: %clang_cc1 -ffreestanding -fsyntax-only -verify -fshort-wchar %s
+// expected-no-diagnostics
#include <stdint.h>
// Check that wmmintrin.h is includable with just -maes.
// RUN: %clang_cc1 -triple x86_64-unknown-unknown \
// RUN: -verify %s -ffreestanding -target-feature +aes
+// expected-no-diagnostics
#include <wmmintrin.h>
// RUN: %clang_cc1 -fsyntax-only -verify %s
+// expected-no-diagnostics
__char16_t c16;
void f(__char32_t) { }
// RUN: %clang_cc1 -fsyntax-only -verify -ffreestanding %s
+// expected-no-diagnostics
%:include <stdint.h>
// RUN: %clang_cc1 -DGNU_KEYWORDS -std=c99 -fgnu-keywords -fsyntax-only -verify %s
// RUN: %clang_cc1 -std=c99 -fsyntax-only -verify %s
// RUN: %clang_cc1 -std=gnu89 -fno-gnu-keywords -fsyntax-only -verify %s
+// expected-no-diagnostics
void f() {
#ifdef GNU_KEYWORDS
#if !defined(__cplusplus)
# if __STDC_VERSION__ < 199901L
-/* expected-error@19 {{'long long' is an extension when C99 mode is not enabled}} */
+/* expected-error@21 {{'long long' is an extension when C99 mode is not enabled}} */
+# else
+/* expected-no-diagnostics */
# endif
#else
# if __cplusplus < 201103L
-/* expected-error@19 {{'long long' is a C++11 extension}} */
+/* expected-error@21 {{'long long' is a C++11 extension}} */
# else
-/* expected-warning@19 {{'long long' is incompatible with C++98}} */
+/* expected-warning@21 {{'long long' is incompatible with C++98}} */
# endif
#endif
// RUN: %clang_cc1 -fsyntax-only -verify -fms-extensions %s
+// expected-no-diagnostics
int x;
// RUN: %clang_cc1 -fsyntax-only -std=c++11 -Wnewline-eof -verify %s
+// expected-no-diagnostics
// The following line isn't terminated, don't fix it.
void foo() {}
\ No newline at end of file
/* RUN: %clang_cc1 -fsyntax-only -verify %s
- */
+ * expected-no-diagnostics */
# define XRECORD(x, c_name) e##c (x, __LINE__)
// RUN: %clang_cc1 %s -fsyntax-only -verify
+// expected-no-diagnostics
// Lexer diagnostics shouldn't be included in #pragma mark.
#pragma mark Mike's world
* RUN: %clang_cc1 -triple x86_64-unknown-unknown -std=gnu89 -fsyntax-only -verify %s
rdar://6096838
*/
+// expected-no-diagnostics
long double d = 0x0.0000003ffffffff00000p-16357L;
/* RUN: %clang_cc1 -fsyntax-only -verify -std=c89 -ffreestanding -pedantic-errors %s
+ * expected-no-diagnostics
* rdar://6814950
*/
#include <stdint.h>
float *f0(float*);
+// expected-no-diagnostics
// RUN: rm -rf %t
// RUN: %clang -fsyntax-only -fmodules -fmodule-cache-path %t -D__need_wint_t %s -Xclang -verify
+// expected-no-diagnostics
#ifdef __SSE__
@__experimental_modules_import _Builtin_intrinsics.intel.sse;
// RUN: rm -rf %t
// RUN: %clang_cc1 -fmodules -fmodule-cache-path %t -F %S/Inputs -I %S/Inputs -verify %s
+// expected-no-diagnostics
#import "point.h"
@__experimental_modules_import Module;
// RUN: rm -rf %t
// RUN: %clang_cc1 -x objective-c -Wauto-import -fmodule-cache-path %t -fmodules -F %S/Inputs %s -verify
+// expected-no-diagnostics
@__experimental_modules_import Module.Sub;
// RUN: rm -rf %t
// RUN: %clang_cc1 -fmodules -fmodule-cache-path %t -F %S/Inputs -DFOO_RETURNS_INT_PTR -verify %s
// RUN: %clang_cc1 -fmodules -fmodule-cache-path %t -F %S/Inputs -verify %s
+// expected-no-diagnostics
@__experimental_modules_import CmdLine;
// RUN: %clang_cc1 -fmodules -x objective-c -fmodule-cache-path %t -emit-module -fmodule-name=redeclarations_left %S/Inputs/module.map
// RUN: %clang_cc1 -fmodules -x objective-c -fmodule-cache-path %t -emit-module -fmodule-name=redeclarations_right %S/Inputs/module.map
// RUN: %clang_cc1 -fmodules -fmodule-cache-path %t %s -verify
+// expected-no-diagnostics
// RUN: rm -rf %t
// RUN: %clang_cc1 -Wauto-import -fmodule-cache-path %t -fmodules -F %S/Inputs %s -verify
+// expected-no-diagnostics
// Note: transitively imports Module.Sub2.
@__experimental_modules_import Module.Sub;
// RUN: rm -rf %t
// RUN: %clang_cc1 -x objective-c++ -fmodules -fmodule-cache-path %t -I %S/Inputs -verify %s -Wno-objc-root-class
// RUN: %clang_cc1 -x objective-c++ -fmodules -fmodule-cache-path %t -I %S/Inputs -emit-llvm %s -o - -Wno-objc-root-class | grep Emit | FileCheck %s
+// expected-no-diagnostics
@__experimental_modules_import templates_left;
@__experimental_modules_import templates_right;
// RUN: %clang_cc1 -triple=x86_64-unknown-freebsd7.0 -emit-pch -x c-header -o %t %S/Inputs/__va_list_tag.h
// RUN: %clang_cc1 -triple=x86_64-unknown-freebsd7.0 -include-pch %t %s -verify
+// expected-no-diagnostics
+
int myvprintf(const char *fmt, va_list args) {
return myvfprintf(fmt, args);
}
// RUN: %clang_cc1 -triple i386-unknown-unknown -emit-pch -o %t %S/asm.h
// RUN: %clang_cc1 -triple i386-unknown-unknown -include-pch %t -fsyntax-only -verify %s
+// expected-no-diagnostics
void call_f(void) { f(); }
// RUN: %clang_cc1 -emit-pch -o %t %S/builtins.h
// RUN: %clang_cc1 -include-pch %t -fsyntax-only -verify %s
+// expected-no-diagnostics
+
void hello() {
printf("Hello, World!");
}
// With PCH
// RUN: %clang_cc1 -fsyntax-only -verify %s -chain-include %s -chain-include %s
+// expected-no-diagnostics
+
#ifndef HEADER1
#define HEADER1
//===----------------------------------------------------------------------===//
// With PCH
// RUN: %clang_cc1 -fsyntax-only -verify -triple x86_64-apple-darwin10 -fobjc-arc %s -chain-include %s -chain-include %s
+// expected-no-diagnostics
+
#ifndef HEADER1
#define HEADER1
//===----------------------------------------------------------------------===//
// With PCH
// RUN: %clang_cc1 -fsyntax-only -verify %s -chain-include %s -chain-include %s
+// expected-no-diagnostics
+
#ifndef HEADER1
#define HEADER1
//===----------------------------------------------------------------------===//
// RUN: %clang_cc1 -include-pch %t2 -fsyntax-only -verify %s
// RUN: %clang_cc1 -ast-print -include-pch %t2 %s | FileCheck %s
+// expected-no-diagnostics
+
// CHECK: void f();
// CHECK: void g();
// RUN: %clang_cc1 -emit-pch -o %t2 -detailed-preprocessing-record %S/Inputs/chain-macro2.h -include-pch %t1
// RUN: %clang_cc1 -fsyntax-only -verify -include-pch %t2 %s
// RUN: %clang_cc1 -ast-print -include-pch %t2 %s | FileCheck %s
+// expected-no-diagnostics
// CHECK: void f();
FOOBAR
// RUN: %clang_cc1 -emit-pch -x objective-c-header -o %t2 %S/Inputs/chain-remap-types2.h -include-pch %t1
// RUN: %clang_cc1 -include-pch %t2 -fsyntax-only -verify %s
// RUN: %clang_cc1 -ast-print -include-pch %t2 %s | FileCheck %s
+// expected-no-diagnostics
// CHECK: @class X;
// CHECK: struct Y
// RUN: %clang_cc1 %s -include-pch %t -fsyntax-only -verify
// RUN: %clang_cc1 -x c-header %S/cmdline-include1.h -emit-pch -o %t
// RUN: %clang_cc1 %s -include-pch %t -include %S/cmdline-include2.h -fsyntax-only -verify
+// expected-no-diagnostics
int g = x1 + x2;
// RUN: %clang_cc1 -std=c++11 -emit-pch -o %t %s
// RUN: %clang_cc1 -include-pch %t -verify -std=c++11 %s
+// expected-no-diagnostics
+
#ifndef HEADER
#define HEADER
// RUN: %clang_cc1 -x c++-header -emit-pch -o %t %S/cxx-friends.h
// RUN: %clang_cc1 -include-pch %t -fsyntax-only -verify %s
+// expected-no-diagnostics
+
class F {
void m() {
A* a;
// RUN: %clang_cc1 -x c++-header -emit-pch -o %t %S/cxx-functions.h
// RUN: %clang_cc1 -include-pch %t -fsyntax-only -verify %s
+// expected-no-diagnostics
+
void test_foo() {
foo();
// Test with PCH
// RUN: %clang_cc1 -std=c++11 -x c++-header -emit-pch -o %t %s
// RUN: %clang_cc1 -std=c++11 -include-pch %t -verify %s
+// expected-no-diagnostics
// PR10847
#ifndef HEADER
// RUN: %clang_cc1 -x c++ -emit-pch %S/Inputs/cxx-method.h -o %t
// RUN: %clang_cc1 -include-pch %t -verify %s
+// expected-no-diagnostics
void S::m(int x) { }
// RUN: %clang_cc1 -fms-extensions -triple i386-unknown-unknown -x c++-header -emit-pch -o %t %S/cxx-ms-function-specialization-class-scope.h
// RUN: %clang_cc1 -fms-extensions -triple i386-unknown-unknown -include-pch %t -fsyntax-only -verify %s
+// expected-no-diagnostics
void test2()
// RUN: %clang_cc1 -x c++-header -emit-pch -o %t %S/cxx-namespaces.h
// RUN: %clang_cc1 -include-pch %t -fsyntax-only -verify %s
+// expected-no-diagnostics
+
void m() {
N::x = 0;
}
// RUN: %clang_cc1 -std=c++11 -fcxx-exceptions -fexceptions -include-pch %t -verify %s -ast-dump -o -
// RUN: %clang_cc1 -std=c++11 -fcxx-exceptions -fexceptions -include-pch %t %s -emit-llvm -o - | FileCheck %s
+// expected-no-diagnostics
+
// CHECK: define weak_odr void @_ZN2S4IiE1mEv
// CHECK: define linkonce_odr void @_ZN2S3IiE1mEv
// RUN: %clang_cc1 -x c++-header -std=c++11 -emit-pch -o %t %S/cxx-traits.h
// RUN: %clang_cc1 -std=c++11 -include-pch %t -fsyntax-only -verify %s
+// expected-no-diagnostics
+
bool _Is_pod_comparator = __is_pod<int>::__value;
bool _Is_empty_check = __is_empty<int>::__value;
// RUN: %clang -ccc-pch-is-pch -x c++-header -o %t.gch %S/cxx-typeid.h
// RUN: %clang -ccc-pch-is-pch -include %t -fsyntax-only -Xclang -verify %s
+// expected-no-diagnostics
+
void f() {
(void)typeid(int);
}
// RUN: %clang_cc1 -std=c++11 -include-pch %t -verify %s -ast-dump -o -
// RUN: %clang_cc1 -std=c++11 -include-pch %t %s -emit-llvm -o - | FileCheck %s
+// expected-no-diagnostics
+
// CHECK: allocate_shared
shared_ptr<int> spi = shared_ptr<int>::allocate_shared(1, 2);
// RUN: %clang_cc1 -pedantic-errors -std=c++11 -emit-pch %s -o %t
// RUN: %clang_cc1 -pedantic-errors -std=c++11 -include-pch %t -verify %s
+// expected-no-diagnostics
#ifndef HEADER_INCLUDED
// RUN: %clang_cc1 -fcxx-exceptions -fexceptions -x c++-header -std=c++11 -emit-pch -o %t %S/cxx_exprs.h
// RUN: %clang_cc1 -fcxx-exceptions -fexceptions -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-dump
+// expected-no-diagnostics
+
int integer;
double floating;
char character;
// RUN: %clang_cc1 -emit-pch -o %t %S/enum.h
// RUN: %clang_cc1 -include-pch %t -fsyntax-only -verify %s
+// expected-no-diagnostics
+
int i = Red;
int return_enum_constant() {
// Test with pch.
// RUN: %clang_cc1 -emit-pch -fblocks -o %t %S/exprs.h
-// RUN: %clang_cc1 -fblocks -include-pch %t -fsyntax-only -verify %s
+// RUN: %clang_cc1 -fblocks -include-pch %t -fsyntax-only -verify %s -DWITH_PCH
+
+#ifdef WITH_PCH
+// expected-no-diagnostics
+#endif
__SIZE_TYPE__ size_type_value;
int integer;
// RUN: %clang -cc1 -include-pch %t -ast-print %s | FileCheck -check-prefix=PRINT %s
// RUN: %clang -cc1 -include-pch %t -emit-llvm -o - %s | FileCheck -check-prefix=IR %s
+// expected-no-diagnostics
+
// CHECK-PRINT: id oldObject = array[10];
// CHECK-PRINT: array[10] = oldObject;
// CHECK-PRINT: oldObject = dictionary[key];
// RUN: %clang_cc1 -x objective-c -emit-pch -o %t %S/objc_import.h
// RUN: %clang_cc1 -include-pch %t -fsyntax-only -verify %s
+// expected-no-diagnostics
+
#import "objc_import.h"
void func() {
// RUN: %clang -cc1 -include-pch %t -ast-print %s | FileCheck -check-prefix=PRINT %s
// RUN: %clang -cc1 -include-pch %t -emit-llvm -o - %s | FileCheck -check-prefix=IR %s
+// expected-no-diagnostics
+
#ifndef HEADER
#define HEADER
// RUN: %clang -cc1 -include-pch %t -x objective-c++ -std=c++0x -ast-print %s | FileCheck -check-prefix=PRINT %s
// RUN: %clang -cc1 -include-pch %t -x objective-c++ -std=c++0x -emit-llvm -o - %s | FileCheck -check-prefix=IR %s
+// expected-no-diagnostics
+
#ifndef HEADER
#define HEADER
// RUN: %clang_cc1 -x objective-c -emit-pch -o %t %S/objc_methods.h
// RUN: %clang_cc1 -include-pch %t -fsyntax-only -verify %s
+// expected-no-diagnostics
+
void func() {
TestPCH *xx;
TestForwardClassDecl *yy;
// RUN: %clang_cc1 -x objective-c -emit-pch -o %t %S/objc_property.h
// RUN: %clang_cc1 -include-pch %t -fsyntax-only -verify %s
+// expected-no-diagnostics
+
void func() {
TestProperties *xx = [TestProperties alloc];
xx.value = 5;
// RUN: %clang_cc1 %s -emit-pch -o %t
// RUN: %clang_cc1 -emit-llvm-only -verify %s -include-pch %t -g
+// expected-no-diagnostics
+
#ifndef HEADER
#define HEADER
//===----------------------------------------------------------------------===//
// RUN: %clang_cc1 %s -emit-pch -o %t
// RUN: %clang_cc1 %s -include-pch %t -verify -fsyntax-only
+// expected-no-diagnostics
+
#ifndef HEADER
#define HEADER
// RUN: %clang_cc1 %s -emit-pch -o %t
// RUN: %clang_cc1 %s -include-pch %t -verify -fsyntax-only
+// expected-no-diagnostics
+
#ifndef HEADER
#define HEADER
// RUN: %clang_cc1 %s -emit-pch -o %t -Wsign-compare -Wtautological-compare
// RUN: %clang_cc1 %s -include-pch %t -verify -fsyntax-only -Wno-sign-compare -Wtautological-compare
+// expected-no-diagnostics
+
// This tests that diagnostic mappings from PCH are propagated for #pragma
// diagnostics but not for command-line flags.
// RUN: %clang_cc1 -x c++-header %S/reinclude2.h -include-pch %t1 -emit-pch -o %t2
// RUN: %clang_cc1 %s -include-pch %t2 -fsyntax-only -verify
+// expected-no-diagnostics
+
int q2 = A::y;
// RUN: %clang_cc1 %s -emit-pch -o %t
// RUN: %clang_cc1 %s -include-pch %t -verify -fsyntax-only
+// expected-no-diagnostics
+
#ifndef HEADER
#define HEADER
// RUN: %clang_cc1 -fsyntax-only -fblocks -verify %s
+// expected-no-diagnostics
int printf(const char *, ...);
void _Block_byref_release(void*src){}
// RUN: %clang_cc1 -fsyntax-only -verify -fblocks %s
+// expected-no-diagnostics
int printf(char const *, ...);
// RUN: %clang_cc1 -fsyntax-only -verify %s
+// expected-no-diagnostics
@interface Subclass
+ (int)magicNumber;
// RUN: %clang_cc1 -fsyntax-only -verify %s
+// expected-no-diagnostics
int main() {
char *s;
s = (char []){"whatever"};
// RUN: %clang_cc1 -fsyntax-only -verify %s
+// expected-no-diagnostics
class c {
virtual void f1(const char* a, ...)
// RUN: %clang_cc1 -fsyntax-only -verify %s
+// expected-no-diagnostics
extern "C" int myarray[];
int myarray[12] = {0};
// RUN: %clang_cc1 -fsyntax-only -verify -std=c++11 %s
+// expected-no-diagnostics
struct Base {
virtual void override();
// RUN: %clang_cc1 -fsyntax-only -verify %s -std=c++11
+// expected-no-diagnostics
struct S {
S(int, int) {}
// RUN: %clang_cc1 -fsyntax-only -verify %s
+// expected-no-diagnostics
int main(void) {
const char ch = @encode(char *)[0];
// RUN: %clang_cc1 -fsyntax-only -verify %s
+// expected-no-diagnostics
@protocol MyProto1
@optional
// RUN: %clang_cc1 -fsyntax-only -verify -std=c90 %s
+// expected-no-diagnostics
int f (int z)
{
// RUN: %clang_cc1 -fsyntax-only -W -Wall -Werror -verify %s
+// expected-no-diagnostics
int f(int i __attribute__((__unused__)))
{
// RUN: %clang_cc1 -verify %s
+// expected-no-diagnostics
typedef int Object;
// RUN: %clang_cc1 -verify %s
+// expected-no-diagnostics
typedef int Object;
// RUN: %clang_cc1 %s -verify -pedantic -fsyntax-only
+// expected-no-diagnostics
__kernel void test()
{
// RUN: %clang_cc1 -fsyntax-only -verify %s
+// expected-no-diagnostics
void f (int p[]) { p++; }
// RUN: %clang_cc1 -triple i386-apple-darwin9 -fsyntax-only -verify %s
+// expected-no-diagnostics
class C {
#pragma options align=natural
// RUN: %clang_cc1 -fsyntax-only %s -verify
+// expected-no-diagnostics
class outer {
class inner1 { inner1(); };
class inner2 { inner2(); };
// RUN: %clang_cc1 -fsyntax-only -verify %s
// RUN: %clang_cc1 -x objective-c++ -fsyntax-only -verify %s
+// expected-no-diagnostics
// rdar://8366474
int main() {
// RUN: %clang_cc1 -fsyntax-only -pedantic -std=c++11 -verify %s
+// expected-no-diagnostics
void foo();
// RUN: %clang_cc1 %s -fsyntax-only -verify
+// expected-no-diagnostics
// Test the X can be overloaded inside the struct.
typedef int X;
// RUN: %clang_cc1 %s -E -CC -pedantic -verify
+// expected-no-diagnostics
#if 1 /*bar */
RUN: %clang_cc1 -E %s -x c | not grep block
RUN: %clang_cc1 -E %s -x c++ -verify -Wundef
*/
+// expected-no-diagnostics
#if true
block_1
// RUN: %clang_cc1 %s -E -CC -pedantic -verify
+// expected-no-diagnostics
#define FOO && 1
#if defined FOO FOO
// RUN: %clang_cc1 < %s -E -verify -triple i686-pc-linux-gnu
+// expected-no-diagnostics
#if (('1234' >> 24) != '1')
#error Bad multichar constant calculation!
// RUN: %clang_cc1 -fms-extensions -Wno-invalid-token-paste %s -verify
// RUN: %clang_cc1 -E -fms-extensions -Wno-invalid-token-paste %s | FileCheck %s
// RUN: %clang_cc1 -E -fms-extensions -Wno-invalid-token-paste -x assembler-with-cpp %s | FileCheck %s
+// expected-no-diagnostics
#define foo a ## b ## = 0
int foo;
// RUN: %clang_cc1 %s -fsyntax-only -verify -pedantic -ffreestanding
+// expected-no-diagnostics
#import <stdint.h> // no warning on #import in objc mode.
// RUN: %clang_cc1 -Eonly %s -DOPT_O2 -O2 -verify
#ifdef OPT_O2
+ // expected-no-diagnostics
#ifndef __OPTIMIZE__
#error "__OPTIMIZE__ not defined"
#endif
// RUN: %clang_cc1 -Eonly %s -DOPT_O0 -O0 -verify
#ifdef OPT_O0
+ // expected-no-diagnostics
#ifdef __OPTIMIZE__
#error "__OPTIMIZE__ defined"
#endif
// RUN: %clang_cc1 -Eonly %s -DOPT_OS -Os -verify
#ifdef OPT_OS
+ // expected-no-diagnostics
#ifndef __OPTIMIZE__
#error "__OPTIMIZE__ not defined"
#endif
// RUN: %clang_cc1 -verify -pedantic %s -fsyntax-only
// RUN: %clang_cc1 -E %s | FileCheck %s
+// expected-no-diagnostics
// rdar://6899937
#include "pragma_sysheader.h"
// CHECK-NEXT: # 1 "{{.*}}pragma_sysheader.h" 3
// CHECK-NEXT: typedef int x;
// CHECK-NEXT: typedef int x;
-// CHECK-NEXT: # 5 "{{.*}}pragma_sysheader.c" 2
+// CHECK-NEXT: # 6 "{{.*}}pragma_sysheader.c" 2
// RUN: %clang -cc1 -fsyntax-only -F %S/Inputs -Wsign-conversion -verify %s
+// expected-no-diagnostics
// Check that TestFramework is treated as a system header.
#include <TestFramework/TestFramework.h>
// RUN: %clang_cc1 -verify -fsyntax-only -std=c90 %s
// RUN: %clang_cc1 -verify -fsyntax-only -std=c99 %s
+// expected-no-diagnostics
int f (int x)
{
// RUN: %clang_cc1 -verify -fsyntax-only -std=c90 %s
// RUN: %clang_cc1 -verify -fsyntax-only -std=c99 %s
+// expected-no-diagnostics
struct s
{
// RUN: %clang_cc1 -fsyntax-only -verify %s
+// expected-no-diagnostics
// Test for absence of crash reported in PR 2923:
//
// RUN: %clang_cc1 -fsyntax-only -verify %s
+// expected-no-diagnostics
int i;
int a[] = {0};
// RUN: %clang_cc1 -triple arm-unknown-unknown -target-abi apcs-gnu -fsyntax-only -verify %s
+// expected-no-diagnostics
struct s0 { double f0; int f1; };
char chk0[__alignof__(struct s0) == 4 ? 1 : -1];
// RUN: %clang_cc1 -triple x86_64-pc-linux-gnu -fsyntax-only -verify %s
+// expected-no-diagnostics
// PR5599
// RUN: %clang_cc1 -triple i386-apple-darwin9 -fsyntax-only -verify %s
+// expected-no-diagnostics
// PR3433
double g1;
// RUN: %clang_cc1 -fsyntax-only -std=c99 -verify %s
+// expected-no-diagnostics
void bb(int sz, int ar[sz][sz]) { }
// RUN: %clang_cc1 -fsyntax-only -verify %s
+// expected-no-diagnostics
void aa(int b, int x[sizeof b]) {}
void foo(int i, int A[i]) {}
// RUN: %clang_cc1 -triple armv7-unknown-unknown -target-abi apcs-gnu %s -verify
// RUN: %clang_cc1 -triple armv7-unknown-unknown -target-abi aapcs %s -verify
+// expected-no-diagnostics
#define check(name, cond) int _##name##_check[(cond) ? 1 : -1]
// RUN: %clang_cc1 -fsyntax-only -verify %s
+// expected-no-diagnostics
#include <stddef.h>
// RUN: %clang_cc1 %s -fsyntax-only -verify -triple=i686-apple-darwin9
+// expected-no-diagnostics
#define CHECK_SIZE(kind, name, size) extern int name##1[sizeof(kind name) == size ? 1 : -1];
#define CHECK_ALIGN(kind, name, size) extern int name##2[__alignof(kind name) == size ? 1 : -1];
// RUN: %clang_cc1 -fsyntax-only -verify %s
+// expected-no-diagnostics
struct {unsigned x : 2;} x;
__typeof__((x.x+=1)+1) y;
__typeof__(x.x<<1) y;
// RUN: %clang_cc1 %s -fsyntax-only -verify -fblocks
+// expected-no-diagnostics
int printf(const char *, ...);
void _Block_byref_release(void*src){}
// RUN: %clang_cc1 %s -fsyntax-only -verify
+// expected-no-diagnostics
// rdar://8632525
typedef struct objc_class *Class;
// RUN: %clang_cc1 %s -fsyntax-only -verify -triple=i686-mingw32
// RUN: %clang_cc1 %s -fsyntax-only -verify -triple=x86_64-mingw32
+// expected-no-diagnostics
// mingw-w64's intrin.h has decls below.
// we should accept them.
// RUN: %clang_cc1 -fsyntax-only -verify %s
+// expected-no-diagnostics
int printf(const char *, ...);
typedef int *pint;
// RUN: %clang_cc1 %s -verify -fsyntax-only
+// expected-no-diagnostics
float a;
// RUN: %clang_cc1 -fsyntax-only -verify -triple x86_64-linux %s
+// expected-no-diagnostics
#define EVAL_EXPR(testno, expr) int test##testno = sizeof(struct{char qq[expr];});
// RUN: %clang_cc1 -fsyntax-only -verify -ffreestanding %s
+// expected-no-diagnostics
#include <stdint.h>
// RUN: %clang_cc1 -fsyntax-only %s -verify -pedantic
+// expected-no-diagnostics
// Math stuff
// RUN: %clang_cc1 -fsyntax-only -verify %s
+// expected-no-diagnostics
typedef long unsigned int __darwin_size_t;
typedef long __darwin_ssize_t;
typedef __darwin_size_t size_t;
// RUN: %clang_cc1 -fsyntax-only -verify %s
+// expected-no-diagnostics
// PR7477
enum __attribute__((packed)) E {
// RUN: %clang_cc1 %s -fsyntax-only -verify -std=c99
+// expected-no-diagnostics
// rdar://6095180
struct s { char c[17]; };
// RUN: %clang_cc1 %s -fsyntax-only -verify -std=c89
+// expected-no-diagnostics
// rdar://6095180
struct s { char c[17]; };
// RUN: %clang_cc1 -fsyntax-only -verify %s -triple i686-pc-linux-gnu
+// expected-no-diagnostics
// PR 4142 - support glibc extension to printf: '%m' (which prints strerror(errno)).
int printf(char const*,...);
// RUN: %clang_cc1 -fsyntax-only -verify -ffreestanding %s
+// expected-no-diagnostics
int malloc(int a) { return a; }
// RUN: %clang_cc1 -fsyntax-only -verify < %s
+// expected-no-diagnostics
typedef float CGFloat;
typedef struct _NSPoint { CGFloat x; CGFloat y; } NSPoint;
typedef struct _NSSize { CGFloat width; CGFloat height; } NSSize;
// RUN: %clang_cc1 -fsyntax-only -verify %s
+// expected-no-diagnostics
typedef float __attribute__((vector_size (16))) v4f_t;
// RUN: %clang_cc1 -triple=i686-linux-gnu -fsyntax-only -verify %s
+// expected-no-diagnostics
// Check types are the same through redeclaration
unsigned long x;
// RUN: %clang_cc1 -fsyntax-only -verify -pedantic %s
+// expected-no-diagnostics
// PR4287
#include <stdarg.h>
// RUN: %clang_cc1 -fsyntax-only -Wconstant-conversion -verify %s
+// expected-no-diagnostics
// rdar://10913206&10941790
// Check that we don't get stack overflow trying to evaluate a huge number of
// RUN: %clang_cc1 %s -verify -fsyntax-only
+// expected-no-diagnostics
struct simple { int i; };
// RUN: %clang_cc1 -mms-bitfields -fsyntax-only -verify -triple x86_64-apple-darwin9 %s
+// expected-no-diagnostics
// The -mms-bitfields commandline parameter should behave the same
// as the ms_struct attribute.
// RUN: %clang_cc1 %s -fsyntax-only -Wno-unused-value -Wmicrosoft -verify -fms-extensions
+// expected-no-diagnostics
// Wide character predefined identifiers
#define _STR2WSTR(str) L##str
// RUN: %clang_cc1 %s -fsyntax-only -verify
+// expected-no-diagnostics
// rdar:// 9129552
// PR9406
// RUN: %clang_cc1 -triple i386-apple-darwin9 -fsyntax-only -verify %s
+// expected-no-diagnostics
#include <stddef.h>
// RUN: %clang_cc1 -triple i386-apple-darwin9 -fsyntax-only -verify %s
+// expected-no-diagnostics
#pragma pack(push, 1)
struct s0 {
// RUN: %clang_cc1 -triple i686-apple-darwin9 %s -fsyntax-only -verify
+// expected-no-diagnostics
#include <stddef.h>
// RUN: %clang_cc1 -triple i686-apple-darwin9 %s -fsyntax-only -verify
+// expected-no-diagnostics
// Stack: [], Alignment: 8
// RUN: %clang_cc1 -triple i686-apple-darwin9 %s -fsyntax-only -verify
// RUN: %clang_cc1 -triple x86_64-apple-darwin9 %s -fsyntax-only -verify
+// expected-no-diagnostics
// rdar://problem/7095436
#pragma pack(4)
// RUN: %clang_cc1 -triple x86_64-apple-darwin9 %s -fsyntax-only -verify -ffreestanding
+// expected-no-diagnostics
// <rdar://problem/10494810> and PR9560
// Check #pragma pack handling with bitfields.
// RUN: %clang_cc1 -triple i686-apple-darwin9 %s -fsyntax-only -verify
+// expected-no-diagnostics
// Pragma pack handling with tag declarations
// RUN: %clang_cc1 %s -Wno-return-type -fsyntax-only -verify
+// expected-no-diagnostics
int t14() {
return;
// RUN: not %clang_cc1 -fsyntax-only %s -verify
// RUN: %clang_cc1 -fshort-enums -fsyntax-only %s -verify
+// expected-no-diagnostics
enum x { A };
int t0[sizeof(enum x) == 1 ? 1 : -1];
// RUN: %clang_cc1 -fsyntax-only %s -verify
+// expected-no-diagnostics
struct S {
int one;
// RUN: %clang_cc1 %s -fsyntax-only -verify
+// expected-no-diagnostics
// Packed structs.
struct s {
// RUN: %clang_cc1 -fsyntax-only -Wno-deprecated-declarations -verify %s
+// expected-no-diagnostics
extern void OldFunction() __attribute__((deprecated));
int main (int argc, const char * argv[]) {
// RUN: %clang_cc1 %s -fsyntax-only -verify
+// expected-no-diagnostics
typedef union {
union wait *__uptr;
// RUN: %clang_cc1 -fsyntax-only -verify %s
+// expected-no-diagnostics
typedef int unary_int_func(int arg);
unary_int_func add_one;
// RUN: %clang_cc1 -fsyntax-only -verify %s
+// expected-no-diagnostics
typedef struct {
int a; int : 24; char b;
} S;
// RUN: %clang_cc1 -fsyntax-only -verify -triple=x86_64-unknown-freebsd7.0 %s
+// expected-no-diagnostics
// PR2631
char* foo(char *fmt, __builtin_va_list ap)
// RUN: %clang_cc1 %s -verify -fsyntax-only -fblocks
+// expected-no-diagnostics
#include <stdarg.h>
// RUN: %clang_cc1 %s -fsyntax-only -pedantic -verify
+// expected-no-diagnostics
// PR4290
// The following declaration is compatible with vfprintf, so we shouldn't
// RUN: %clang_cc1 -Wno-gnu-designator -verify %s
+// expected-no-diagnostics
struct { int x, y, z[12]; } value = { x:17, .z [3 ... 5] = 7 };
// RUN: %clang_cc1 -fsyntax-only -verify -triple x86_64-apple-darwin %s
// RUN: %clang_cc1 -triple i386-apple-darwin9 -fsyntax-only -verify %s
+// expected-no-diagnostics
// rdar://10277579
enum __attribute__((deprecated)) __attribute__((weak_import)) A {
// RUN: %clang_cc1 -fsyntax-only -verify -Wall %s
+// expected-no-diagnostics
// rdar://5683899
void** f(void **Buckets, unsigned NumBuckets) {
return Buckets + NumBuckets;
// RUN: %clang_cc1 %s -fsyntax-only -verify -fms-compatibility
+// expected-no-diagnostics
// PR13153
namespace std {}
// RUN: %clang_cc1 -verify %s
+// expected-no-diagnostics
// PR12223
namespace test1 {
// RUN: %clang_cc1 -fsyntax-only -verify %s -std=c++11
+// expected-no-diagnostics
class C {
public:
// RUN: %clang_cc1 -fsyntax-only -verify %s
+// expected-no-diagnostics
struct X { ~X(); };
template <typename T>
// RUN: %clang_cc1 -fsyntax-only -verify %s
+// expected-no-diagnostics
class Base {
protected:
Base(int val);
// RUN: %clang_cc1 -fsyntax-only -verify -std=c++11 %s
+// expected-no-diagnostics
template <class _Tp, class _Up, bool = false>
struct __allocator_traits_rebind
// RUN: %clang_cc1 -fsyntax-only -verify -std=c++11 %s
+// expected-no-diagnostics
template <class _Tp, class _Up>
struct __allocator_traits_rebind
// RUN: %clang_cc1 -fsyntax-only -verify -fborland-extensions -fcxx-exceptions %s
+// expected-no-diagnostics
// This test is from http://docwiki.embarcadero.com/RADStudio/en/Try
// RUN: %clang_cc1 -std=c++11 -fsyntax-only -verify -pedantic %s
+// expected-no-diagnostics
namespace PR12866 {
struct bar {
// RUN: %clang_cc1 -fsyntax-only -verify %s -fblocks -std=c++11
+// expected-no-diagnostics
extern "C" int exit(int);
// RUN: %clang_cc1 -fsyntax-only -verify %s -fblocks
+// expected-no-diagnostics
void tovoid(void*);
// RUN: %clang_cc1 %s -fsyntax-only -verify -fborland-extensions
+// expected-no-diagnostics
// Borland extensions
// RUN: %clang_cc1 -isystem %S/Inputs -fsyntax-only -verify %s
+// expected-no-diagnostics
#include <malloc.h>
extern "C" {
// RUN: %clang_cc1 -fsyntax-only -verify %s -std=c++11
+// expected-no-diagnostics
struct A {};
// RUN: %clang_cc1 %s -fsyntax-only -verify
+// expected-no-diagnostics
// rdar://8686888
typedef struct objc_selector *SEL;
// RUN: %clang_cc1 -fsyntax-only -verify %s
+// expected-no-diagnostics
struct B { explicit B(bool); };
void f() {
(void)(B)true;
// RUN: %clang_cc1 -triple x86_64-unknown-unknown %s -fsyntax-only -verify
+// expected-no-diagnostics
#define SA(n, p) int a##n[(p) ? 1 : -1]
// RUN: %clang_cc1 -fsyntax-only -verify %s
+// expected-no-diagnostics
// PR6076
void f();
// RUN: %clang_cc1 %s -verify -fsyntax-only -pedantic
+// expected-no-diagnostics
// This file tests the clang extension which allows initializing the components
// of a complex number individually using an initialization list. Basically,
// RUN: %clang_cc1 -verify -std=c++11 %s
+// expected-no-diagnostics
// A direct proof that constexpr is Turing-complete, once DR1454 is implemented.
// RUN: %clang_cc1 -std=c++98 -fsyntax-only -verify %s
+// expected-no-diagnostics
extern int x;
__decltype(1) x = 3;
// RUN: %clang_cc1 -fsyntax-only -verify %s -std=c++11
+// expected-no-diagnostics
template<typename T, T t>
struct TestStruct {
// RUN: %clang_cc1 -fsyntax-only -verify %s -std=c++11
+// expected-no-diagnostics
template< typename T, T t, decltype(t+2) v >
struct Convoluted {};
// RUN: %clang_cc1 -fsyntax-only -verify -std=c++11 %s
+// expected-no-diagnostics
template<typename T, typename U> struct is_same {
static const bool value = false;
// RUN: %clang_cc1 -std=c++11 -fsyntax-only -verify %s
+// expected-no-diagnostics
// PR5290
int const f0();
// RUN: %clang_cc1 -fsyntax-only -verify %s
+// expected-no-diagnostics
struct B { B(void* = 0); };
struct A {
// RUN: %clang_cc1 -fsyntax-only -verify %s
+// expected-no-diagnostics
void test() {
int x;
// RUN: %clang_cc1 -triple x86_64-unknown-unknown %s -fsyntax-only -verify
+// expected-no-diagnostics
#define SA(n, p) int a##n[(p) ? 1 : -1]
// RUN: %clang_cc1 -fsyntax-only -verify -fexceptions -fobjc-exceptions %s
+// expected-no-diagnostics
// Note that we're specifically excluding -fcxx-exceptions in the command line above.
// RUN: %clang_cc1 -fsyntax-only -verify %s
+// expected-no-diagnostics
// <rdar://problem/10204947>
namespace N {
// RUN: %clang_cc1 -verify -Wno-covered-switch-default %s
+// expected-no-diagnostics
enum E {
one,
// RUN: %clang_cc1 -fsyntax-only -verify %s
+// expected-no-diagnostics
//PR9463
int subfun(const char *text) {
// RUN: %clang_cc1 -fsyntax-only -verify %s
+// expected-no-diagnostics
namespace test1 {
// Make sure this doesn't crash.
// RUN: %clang_cc1 -std=c++11 -fsyntax-only -verify %s
+// expected-no-diagnostics
template<typename T>
struct classify_function {
// RUN: %clang_cc1 -fsyntax-only -verify %s
+// expected-no-diagnostics
namespace PR6382 {
int foo()
// RUN: %clang_cc1 -fsyntax-only -verify %s
+// expected-no-diagnostics
namespace A {
class String;
// RUN: %clang_cc1 %s -fsyntax-only -verify
+// expected-no-diagnostics
// PR5543
struct A { int x; union { int* y; float* z; }; }; struct B : A {int a;};
// RUN: %clang_cc1 -fsyntax-only -verify %s
+// expected-no-diagnostics
typedef void (*thread_continue_t)();
extern "C" {
// RUN: %clang_cc1 -triple x86_64-unknown-unknown %s -fsyntax-only -verify
// RUN: %clang_cc1 -triple i686-unknown-unknown %s -fsyntax-only -verify
+// expected-no-diagnostics
#include <stddef.h>
struct A;
// RUN: %clang_cc1 %s -fsyntax-only -verify -fms-extensions
+// expected-no-diagnostics
void f() throw(...) { }
// RUN: %clang_cc1 -fsyntax-only -verify %s
// RUN: %clang_cc1 -DQUALIFIED -fsyntax-only -verify %s
+// expected-no-diagnostics
// PR5904
void f0(int *ptr) {
// RUN: %clang_cc1 -DTEMPLATE_OVERLOAD -fsyntax-only -verify %s
// RUN: %clang_cc1 -fsyntax-only -verify %s
+// expected-no-diagnostics
#include <stddef.h>
// RUN: %clang_cc1 -fsyntax-only -Wno-compare-distinct-pointer-type -verify %s
+// expected-no-diagnostics
// rdar://12501960
void Foo(int **thing, const int **thingMax)
// RUN: %clang_cc1 -std=c++98 -fsyntax-only -verify %s
+// expected-no-diagnostics
void f(void *);
void g() { f(__nullptr); }
// RUN: %clang_cc1 -fsyntax-only -verify %s
+// expected-no-diagnostics
class C {
C(void*);
// RUN: %clang_cc1 -fsyntax-only -fshow-overloads=best -std=c++11 -verify %s
+// expected-no-diagnostics
template <class T>
struct X
// RUN: %clang_cc1 -triple i686-apple-darwin9 -fsyntax-only -verify %s
+// expected-no-diagnostics
namespace rdar8745206 {
// RUN: %clang_cc1 -fsyntax-only -Wunused-parameter -Wunused -verify %s
+// expected-no-diagnostics
struct S {
void m(int x, int y) {
// RUN: %clang_cc1 -fsyntax-only %s -verify
+// expected-no-diagnostics
// PR5679
enum X { A = 3 };
// RUN: %clang_cc1 -fsyntax-only -verify %s
+// expected-no-diagnostics
class A { virtual void f(); };
class B : virtual A { };
// RUN: %clang_cc1 -fsyntax-only -verify %s -std=c++11
+// expected-no-diagnostics
// 13.3.3.2 Ranking implicit conversion sequences
// conversion of A::* to B::* is better than conversion of A::* to C::*,
// RUN: %clang_cc1 -fsyntax-only -verify %s
+// expected-no-diagnostics
// Check that this doesn't crash.
struct A {
// RUN: %clang_cc1 -triple i386-mingw32 -fsyntax-only -pedantic -verify %s
// RUN: %clang_cc1 -fshort-wchar -fsyntax-only -pedantic -verify %s
// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fsyntax-only -pedantic -verify %s
+// expected-no-diagnostics
// Check that short wchar_t is unsigned, and that regular wchar_t is not.
int test[(wchar_t(-1)<wchar_t(0)) == (sizeof(wchar_t) == 4) ?1:-1];
// RUN: %clang_cc1 -fsyntax-only -verify %s
+// expected-no-diagnostics
int f() {
return 10;
}
// RUN: %clang_cc1 -fsyntax-only -verify %s
+// expected-no-diagnostics
// <rdar://problem/9168556>
typedef struct Point Point;
// RUN: %clang_cc1 -fsyntax-only -verify %s -std=c++11
+// expected-no-diagnostics
struct T1 {
};
static_assert(__has_trivial_constructor(T1), "T1 has trivial constructor!");
// RUN: %clang_cc1 -fsyntax-only -verify %s -std=c++11
+// expected-no-diagnostics
struct T1 {
};
static_assert(__has_trivial_destructor(T1), "T1 has trivial destructor!");
// RUN: %clang_cc1 -std=c++11 -fsyntax-only -Wunused -verify %s
+// expected-no-diagnostics
static int foo(int x) { return x; }
// RUN: %clang_cc1 -fsyntax-only -verify %s
+// expected-no-diagnostics
namespace A {
struct B { };
// RUN: %clang_cc1 -fsyntax-only -verify %s
+// expected-no-diagnostics
namespace A {
void g();
// RUN: %clang_cc1 -verify %s
+// expected-no-diagnostics
template <unsigned I>
class C0 {
// RUN: %clang_cc1 %s -verify -fsyntax-only
+// expected-no-diagnostics
// PR5462
void f1(void);
// RUN: %clang_cc1 -triple=x86_64-pc-linux-gnu -Wover-aligned -verify %s
+// expected-no-diagnostics
// This test verifies that we don't warn when the global operator new is
// overridden. That's why we can't merge this with the other test file.
// RUN: %clang_cc1 -fsyntax-only -verify %s
+// expected-no-diagnostics
void f(int (&array1)[2], int (&array2)[2]) {
if (array1 == array2) { } // no warning
// RUN: %clang_cc1 -fsyntax-only -verify %s
+// expected-no-diagnostics
// <rdar://problem/10228639>
class Foo {
// RUN: %clang_cc1 -fsyntax-only -verify -Wno-objc-root-class %s
// RUN: %clang_cc1 -x objective-c++ -fsyntax-only -verify -Wno-objc-root-class %s
+// expected-no-diagnostics
// rdar://10565506
@protocol P @end
// RUN: %clang_cc1 -fsyntax-only -verify -Wno-objc-root-class %s
+// expected-no-diagnostics
@interface MyObject {
int _foo;
// RUN: %clang_cc1 -fobjc-default-synthesize-properties -triple x86_64-apple-darwin11 -fobjc-runtime-has-weak -fobjc-arc -fsyntax-only -verify -Wno-objc-root-class %s
// RUN: %clang_cc1 -x objective-c++ -fobjc-default-synthesize-properties -triple x86_64-apple-darwin11 -fobjc-runtime-has-weak -fobjc-arc -fsyntax-only -verify -Wno-objc-root-class %s
+// expected-no-diagnostics
// rdar:// 10558871
@interface PP
// RUN: %clang_cc1 -triple x86_64-apple-darwin11 -fobjc-runtime-has-weak -fobjc-arc -fsyntax-only -verify -Wno-objc-root-class %s
+// expected-no-diagnostics
// rdar:// 10558871
@interface PP
// RUN: %clang_cc1 -triple x86_64-apple-darwin11 -fsyntax-only -fobjc-arc -fblocks -verify -Wno-objc-root-class %s
+// expected-no-diagnostics
// rdar://10156674
@class NSArray;
// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fsyntax-only -verify -fblocks %s
// RUN: %clang_cc1 -fsyntax-only -verify -fblocks -fobjc-arc %s
+// expected-no-diagnostics
struct X {
__unsafe_unretained id object;
// RUN: %clang_cc1 %s -verify -fsyntax-only
+// expected-no-diagnostics
@class NSString;
// RUN: %clang_cc1 %s -fsyntax-only -verify -fblocks
+// expected-no-diagnostics
@interface Whatever
- copy;
// RUN: %clang_cc1 -fsyntax-only -verify %s -fblocks
+// expected-no-diagnostics
@interface NSObject {
struct objc_object *isa;
// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fsyntax-only -verify -fblocks -fobjc-gc-only %s
+// expected-no-diagnostics
// rdar://8979379
@interface NSString
// RUN: %clang_cc1 -x objective-c %s -fsyntax-only -verify
+// expected-no-diagnostics
// rdar://9362887
typedef __typeof__(((int*)0)-((int*)0)) ptrdiff_t;
// RUN: %clang_cc1 %s -fsyntax-only -verify
+// expected-no-diagnostics
// rdar://8632525
extern id objc_msgSend(id self, SEL op, ...);
// RUN: %clang_cc1 -fsyntax-only -verify %s
+// expected-no-diagnostics
typedef struct objc_class *Class;
@interface NSObject
// RUN: %clang_cc1 -fsyntax-only -verify -Wno-objc-root-class %s
+// expected-no-diagnostics
@interface Foo
@end
// RUN: %clang_cc1 -fsyntax-only -verify -Wno-objc-root-class %s
+// expected-no-diagnostics
typedef struct objc_class *Class;
// RUN: %clang_cc1 -fsyntax-only -verify %s
+// expected-no-diagnostics
@interface Test {}
+ (Test*)one;
// RUN: %clang_cc1 -fsyntax-only -verify %s
+// expected-no-diagnostics
// pr5552
@interface Protocol
// RUN: %clang_cc1 -fsyntax-only -verify %s
+// expected-no-diagnostics
#define nil (void *)0;
#define Nil (void *)0;
// RUN: %clang_cc1 -fsyntax-only -verify %s
+// expected-no-diagnostics
@protocol MyProtocol
@end
// RUN: %clang_cc1 -fsyntax-only -verify -Wno-objc-root-class %s
+// expected-no-diagnostics
@interface PBXBuildSettingsDictionary
{
// RUN: %clang_cc1 -fsyntax-only -verify %s
+// expected-no-diagnostics
@protocol MyProtocol @end
// RUN: %clang_cc1 -fsyntax-only -verify %s
+// expected-no-diagnostics
// radar 7682116
@interface Super @end
// RUN: %clang_cc1 -fsyntax-only -verify %s
+// expected-no-diagnostics
// rdar://9296866
@interface NSResponder
// RUN: %clang_cc1 -verify -fsyntax-only -Wno-objc-root-class %s
+// expected-no-diagnostics
// rdar://8225011
int glob;
// RUN: %clang_cc1 -fsyntax-only -Werror -verify -Wno-objc-root-class %s
+// expected-no-diagnostics
// rdar://10387088
@interface MyClass
// RUN: %clang_cc1 -fsyntax-only -fobjc-default-synthesize-properties -verify -Wno-objc-root-class %s
+// expected-no-diagnostics
// rdar://8673791
// rdar://9943851
// RUN: %clang_cc1 -verify -Wno-objc-root-class %s
+// expected-no-diagnostics
@protocol MyProto1
@optional
// RUN: %clang_cc1 -fsyntax-only -verify %s
+// expected-no-diagnostics
#if !__has_feature(objc_fixed_enum)
# error Enumerations with a fixed underlying type are not supported
// RUN: %clang_cc1 -fsyntax-only -verify -Wno-objc-root-class %s
+// expected-no-diagnostics
@interface MyParent {
int X;
// RUN: %clang_cc1 %s -fsyntax-only -verify
+// expected-no-diagnostics
// id is now builtin. There should be no errors.
id obj;
// RUN: %clang_cc1 -fsyntax-only -verify %s
// RUN: %clang_cc1 -x objective-c++ -fsyntax-only -verify %s
+// expected-no-diagnostics
// rdar://10667659
@protocol NSCopying @end
// RUN: %clang_cc1 -fsyntax-only -verify %s
+// expected-no-diagnostics
@interface foo
+ (void) cx __attribute__((weak_import));
- (void) x __attribute__((weak_import));
// RUN: %clang_cc1 %s -fsyntax-only -verify
+// expected-no-diagnostics
@interface A
{
int ivar;
// RUN: %clang_cc1 %s -fsyntax-only -verify -triple i386-apple-darwin9 -fobjc-runtime=macosx-fragile-10.5
+// expected-no-diagnostics
typedef struct objc_object {} *id;
typedef signed char BOOL;
typedef unsigned int NSUInteger;
// RUN: %clang_cc1 -fsyntax-only -verify -triple i686-apple-darwin9 -Wno-objc-root-class %s
+// expected-no-diagnostics
// FIXME: must also compile as Objective-C++
// <rdar://problem/6487662>
// RUN: %clang_cc1 -fsyntax-only -verify %s
+// expected-no-diagnostics
@interface I1 {
@private
// RUN: %clang_cc1 -fsyntax-only -verify %s
+// expected-no-diagnostics
typedef unsigned char BOOL;
// RUN: %clang_cc1 -fsyntax-only -verify -Wno-objc-root-class %s
+// expected-no-diagnostics
// This test case tests the default behavior.
// RUN: %clang_cc1 -fsyntax-only -verify %s
+// expected-no-diagnostics
// rdar://8530080
@protocol ViewDelegate @end
// RUN: %clang_cc1 -fsyntax-only -verify %s
+// expected-no-diagnostics
typedef signed char BOOL;
@protocol NSObject
// RUN: %clang_cc1 -fsyntax-only -verify %s
+// expected-no-diagnostics
@interface NSObject {}
// RUN: %clang_cc1 -x objective-c -fsyntax-only -verify -Wno-objc-root-class %s
// RUN: %clang_cc1 -x objective-c++ -fsyntax-only -verify -Wno-objc-root-class %s
+// expected-no-diagnostics
// rdar://10041908
@interface Bar {
// RUN: %clang_cc1 -triple i386-apple-darwin9 -fsyntax-only -verify -Wno-objc-root-class %s
+// expected-no-diagnostics
@interface Subtask
{
// RUN: %clang_cc1 -fsyntax-only -fdebugger-support -verify -Wno-objc-root-class %s
// RUN: %clang_cc1 -x objective-c++ -fdebugger-support -fsyntax-only -verify -Wno-objc-root-class %s
+// expected-no-diagnostics
// rdar://10997647
@interface I
// RUN: %clang_cc1 -fsyntax-only -verify -Wno-objc-root-class %s
+// expected-no-diagnostics
// radar 7211563
@interface X
// RUN: %clang_cc1 -fsyntax-only -verify -Wno-objc-root-class %s
+// expected-no-diagnostics
@protocol CYCdef
- (int)name;
// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fsyntax-only -verify %s
+// expected-no-diagnostics
// This program tests that if class implements the forwardInvocation method, then
// every method possible is implemented in the class and should not issue
// warning of the "Method definition not found" kind. */
// RUN: %clang_cc1 -fsyntax-only -verify -Wno-objc-root-class %s
+// expected-no-diagnostics
// rdar://9651605
@interface Foo
// RUN: %clang_cc1 -fsyntax-only -fobjc-arc -fobjc-runtime-has-weak -Wsuper-class-method-mismatch -verify %s
+// expected-no-diagnostics
// rdar://11793793
@class NSString;
// RUN: %clang_cc1 -fblocks -fsyntax-only -verify -Wno-objc-root-class %s
+// expected-no-diagnostics
@interface NSObject
- (id)self;
// RUN: %clang_cc1 -fsyntax-only -verify -Wno-objc-root-class %s
+// expected-no-diagnostics
// rdar://8843851
int* global;
// RUN: %clang_cc1 -fsyntax-only -verify -Wno-objc-root-class %s
+// expected-no-diagnostics
// rdar://9078584
@interface NSObject @end
// RUN: %clang_cc1 -fsyntax-only -verify -Weverything %s
+// expected-no-diagnostics
// rdar://12103434
@class NSString;
// RUN: %clang_cc1 -fsyntax-only -verify -pedantic -Wno-objc-root-class %s
+// expected-no-diagnostics
// rdar: // 7860960
@interface I
// RUN: %clang_cc1 -triple i686-apple-darwin9 -fsyntax-only -verify -Wno-objc-root-class %s
+// expected-no-diagnostics
// Make sure pragma pack works inside ObjC methods. <rdar://problem/10893316>
@interface X
// RUN: %clang_cc1 -fsyntax-only -verify %s
+// expected-no-diagnostics
@interface NSSound
@end
// RUN: %clang_cc1 -fsyntax-only -verify %s -Wno-unreachable-code
+// expected-no-diagnostics
@interface NSObject
+ alloc;
// RUN: %clang_cc1 -fsyntax-only -verify -Wno-objc-root-class %s
+// expected-no-diagnostics
@interface Tester
@property char PropertyAtomic_char;
// RUN: %clang_cc1 -fsyntax-only -verify -fobjc-exceptions %s
+// expected-no-diagnostics
# 1 "<command line>"
# 1 "/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h" 1 3
typedef signed char BOOL;
// RUN: %clang_cc1 -fsyntax-only -verify %s
+// expected-no-diagnostics
typedef signed char BOOL;
typedef struct _NSZone NSZone;
// RUN: %clang_cc1 -fsyntax-only -verify %s
+// expected-no-diagnostics
typedef signed char BOOL;
typedef unsigned int NSUInteger;
typedef struct _NSZone NSZone;
// RUN: %clang_cc1 %s -fsyntax-only -verify
+// expected-no-diagnostics
// rdar://5967199
typedef signed char BOOL;
// RUN: %clang_cc1 -fsyntax-only -verify -Wno-objc-root-class %s
+// expected-no-diagnostics
// Do not issue error if 'ivar' used previously belongs to the inherited class
// and has same name as @dynalic property in current class.
// RUN: %clang_cc1 -fsyntax-only -verify -Wno-objc-root-class %s
// RUN: %clang_cc1 -x objective-c++ -fsyntax-only -verify -Wno-objc-root-class %s
+// expected-no-diagnostics
// rdar://8962253
@interface Singleton {
// RUN: %clang_cc1 -fsyntax-only -verify -Wno-objc-root-class %s
+// expected-no-diagnostics
@interface SSyncCEList
{
// RUN: %clang_cc1 -fsyntax-only -verify %s
+// expected-no-diagnostics
typedef signed char BOOL;
// RUN: %clang_cc1 -fsyntax-only -verify %s
+// expected-no-diagnostics
@interface Object
// RUN: %clang_cc1 -fsyntax-only -Werror -verify -Wno-objc-root-class %s
+// expected-no-diagnostics
@interface MyClass {
const char *_myName;
// RUN: %clang_cc1 -triple i386-apple-darwin9 -fsyntax-only -verify %s
+// expected-no-diagnostics
@interface foo
@property(nonatomic) int foo __attribute__((weak_import));
// RUN: %clang_cc1 -fsyntax-only -verify %s
+// expected-no-diagnostics
typedef signed char BOOL;
@class NSInvocation, NSMethodSignature, NSCoder, NSString, NSEnumerator;
// RUN: %clang_cc1 -fsyntax-only -verify %s
+// expected-no-diagnostics
@protocol fproto;
// RUN: %clang_cc1 -fsyntax-only -verify %s
+// expected-no-diagnostics
@protocol P0
-bar;
// RUN: %clang_cc1 -fsyntax-only -verify %s
+// expected-no-diagnostics
@interface NSObject @end
@protocol ProtocolA
// RUN: %clang_cc1 -fsyntax-only -verify %s
+// expected-no-diagnostics
@protocol NSObject
- retain;
- release;
// RUN: %clang_cc1 -fsyntax-only -verify %s
+// expected-no-diagnostics
#include <stddef.h>
// RUN: %clang_cc1 -fsyntax-only %s -verify -fobjc-exceptions
+// expected-no-diagnostics
// Test case for:
// <rdar://problem/6248119> @finally doesn't introduce a new scope
// RUN: %clang_cc1 -std=gnu99 -fsyntax-only -verify %s
+// expected-no-diagnostics
void f0(restrict id a0) {}
// RUN: %clang_cc1 -verify %s
+// expected-no-diagnostics
@interface I
- (id) compare: (char) arg1;
// RUN: %clang_cc1 -fsyntax-only -Wselector -verify %s
+// expected-no-diagnostics
// rdar://8851684
@interface I
- length;
// RUN: %clang_cc1 -fsyntax-only -triple x86_64-apple-darwin10 -fblocks -verify -Wno-objc-root-class %s
// RUN: %clang_cc1 -x objective-c++ -fsyntax-only -triple x86_64-apple-darwin10 -fblocks -verify -Wno-objc-root-class %s
+// expected-no-diagnostics
// rdar://9154582
@interface Blocky @end
// RUN: %clang_cc1 -fsyntax-only -fblocks -verify %s
+// expected-no-diagnostics
// rdar://9181463
typedef struct objc_class *Class;
// RUN: %clang_cc1 -fsyntax-only -verify %s
+// expected-no-diagnostics
// rdar://8528170
@interface NSObject @end
// RUN: %clang_cc1 -fsyntax-only -verify %s
+// expected-no-diagnostics
typedef signed char BOOL;
typedef unsigned int NSUInteger;
@class NSInvocation, NSMethodSignature, NSCoder, NSString, NSEnumerator;
// RUN: %clang_cc1 -fsyntax-only -verify %s
+// expected-no-diagnostics
@interface SStoreNodeInfo
// RUN: %clang_cc1 -fsyntax-only -verify %s
+// expected-no-diagnostics
@interface B
+(int) classGetter;
// RUN: %clang_cc1 -fsyntax-only -fobjc-default-synthesize-properties -verify -Wno-objc-root-class %s
+// expected-no-diagnostics
// rdar://8913053
typedef unsigned char BOOL;
// RUN: %clang_cc1 -fsyntax-only -verify -Wno-objc-root-class %s
+// expected-no-diagnostics
@interface TestClass
{
// RUN: %clang_cc1 -fsyntax-only -verify -Wno-objc-root-class %s
+// expected-no-diagnostics
typedef union {
struct xx_object_s *_do;
// RUN: %clang_cc1 %s -verify -fsyntax-only
+// expected-no-diagnostics
@class NSString;
extern void NSLog(NSString *format, ...) __attribute__((format(__NSString__, 1, 2)));
// RUN: %clang_cc1 -fsyntax-only -verify %s
+// expected-no-diagnostics
#include <stdarg.h>
// RUN: %clang_cc1 -fsyntax-only -verify %s
+// expected-no-diagnostics
@interface MessageStore
@property (assign, readonly) int P;
// RUN: %clang_cc1 -fsyntax-only -fobjc-arc -verify -fblocks -triple x86_64-apple-darwin10.0.0 %s
+// expected-no-diagnostics
// rdar://9310049
bool fn(id obj) {
// RUN: %clang_cc1 -fsyntax-only -fobjc-arc -fobjc-arc-cxxlib=libstdc++ -fobjc-runtime-has-weak -verify %s
+// expected-no-diagnostics
@interface A @end
// RUN: %clang_cc1 -fsyntax-only -fobjc-arc -verify -fblocks %s
+// expected-no-diagnostics
struct X0 {
static id makeObject1() __attribute__((ns_returns_retained));
// RUN: %clang_cc1 -fsyntax-only -fobjc-arc -fobjc-runtime-has-weak -verify -std=c++11 %s
+// expected-no-diagnostics
// Check the results of the various type-trait query functions on
// lifetime-qualified types in ARC.
// RUN: %clang_cc1 -fsyntax-only -verify %s
+// expected-no-diagnostics
// <rdar://problem/9142559>: For the purposes of Argument-Dependent
// Lookup, Objective-C classes are considered to be in the global
// RUN: %clang_cc1 -fsyntax-only -verify -Wno-objc-root-class %s
+// expected-no-diagnostics
@interface Foo
@end
// RUN: %clang_cc1 -fsyntax-only -verify %s
+// expected-no-diagnostics
@protocol P1
@end
// RUN: %clang_cc1 -fsyntax-only -verify %s
+// expected-no-diagnostics
// rdar: // 7963410
@protocol NSObject @end
// RUN: %clang_cc1 -fsyntax-only -verify %s
+// expected-no-diagnostics
// rdar: // 7963410
template<class T>
// RUN: %clang_cc1 -fdebugger-support -fsyntax-only -verify %s
+// expected-no-diagnostics
@class NSString;
void testCompareAgainstPtr(int *ptr, NSString *ns) {
// RUN: %clang_cc1 -x objective-c++ -std=c++11 -fsyntax-only -Werror -verify -Wno-objc-root-class %s
+// expected-no-diagnostics
// rdar://10387088
struct X {
// RUN: %clang_cc1 -x objective-c++ -fsyntax-only -Werror -verify -Wno-objc-root-class %s
+// expected-no-diagnostics
// rdar://10387088
@interface MyClass
// RUN: %clang_cc1 -x objective-c++ -fcxx-exceptions -fsyntax-only -Werror -verify -Wno-objc-root-class %s
+// expected-no-diagnostics
// rdar://10387088
@interface MyClass
// RUN: %clang_cc1 %s -verify -pedantic -fsyntax-only
+// expected-no-diagnostics
// rdar://8366474
void *P = @selector(foo::bar::);
// RUN: %clang_cc1 -fsyntax-only -verify %s
+// expected-no-diagnostics
extern "C" id (*_dealloc)(id) ;
// RUN: %clang_cc1 -fsyntax-only -verify -Wno-objc-root-class %s
+// expected-no-diagnostics
// PR7386
@class NSObject;
// RUN: %clang_cc1 -fsyntax-only -verify -Wno-objc-root-class %s
+// expected-no-diagnostics
@interface Ivar
- (float*)method;
@end
// RUN: %clang_cc1 -fsyntax-only -verify %s
+// expected-no-diagnostics
@interface A {
struct X {
int x, y;
// RUN: %clang_cc1 -fsyntax-only -verify %s
+// expected-no-diagnostics
extern "C" {
@class Protocol;
}
// RUN: %clang_cc1 -fsyntax-only -verify %s
+// expected-no-diagnostics
// <rdar://problem/9388207>
@interface A
// RUN: %clang_cc1 -fsyntax-only -verify -Wnull-arithmetic %s
+// expected-no-diagnostics
#define NULL __null
@interface X
// RUN: %clang_cc1 -std=c++11 -fblocks -fsyntax-only -verify %s
+// expected-no-diagnostics
@interface A
@end
// RUN: %clang_cc1 -fsyntax-only -triple i386-apple-darwin9 -fobjc-gc -verify %s
+// expected-no-diagnostics
void f0(__weak id *);
// RUN: %clang_cc1 -fsyntax-only -verify %s
+// expected-no-diagnostics
@interface G
@end
// RUN: %clang_cc1 -fsyntax-only -verify %s
+// expected-no-diagnostics
// rdar://9740328
@protocol P1;
// RUN: %clang_cc1 -verify -emit-llvm -o - %s
+// expected-no-diagnostics
// Test reference binding.
// RUN: %clang_cc1 -fsyntax-only -verify %s
+// expected-no-diagnostics
@interface NSString @end
// RUN: %clang_cc1 -fsyntax-only -verify %s
+// expected-no-diagnostics
#define FOR_EACH_KEYWORD(macro) \
macro(asm) \
// RUN: %clang_cc1 -fsyntax-only -verify %s
+// expected-no-diagnostics
@class NSString;
id a;
// RUN: %clang_cc1 -fsyntax-only -verify %s
+// expected-no-diagnostics
@protocol NSTextViewDelegate;
// RUN: %clang_cc1 -fsyntax-only -verify %s
+// expected-no-diagnostics
@interface Data
- (unsigned)length;
// RUN: %clang_cc1 %s -verify -pedantic -fsyntax-only
+// expected-no-diagnostics
typedef __attribute__((ext_vector_type(4))) float float4;
// RUN: %clang_cc1 %s -verify -pedantic -fsyntax-only
+// expected-no-diagnostics
typedef float float8 __attribute((ext_vector_type(8)));
// RUN: %clang_cc1 %s -verify -pedantic -fsyntax-only
+// expected-no-diagnostics
typedef __attribute__((ext_vector_type(2))) unsigned int uint2;
typedef __attribute__((ext_vector_type(2))) int int2;
// RUN: %clang_cc1 %s -verify -pedantic -fsyntax-only
+// expected-no-diagnostics
typedef int int2 __attribute((ext_vector_type(2)));
typedef int int3 __attribute((ext_vector_type(3)));
// RUN: %clang_cc1 -fsyntax-only -verify %s
+// expected-no-diagnostics
// template<unsigned M, unsigned N>
// struct Ackermann {
// RUN: %clang_cc1 -std=c++11 -fsyntax-only -verify %s
+// expected-no-diagnostics
template<template<template<typename> class, typename> class T, template<typename> class V> struct PartialApply {
template<typename W> using R = T<V, W>;
// RUN: %clang_cc1 -fsyntax-only -verify -std=c++11 %s
+// expected-no-diagnostics
template<template<typename> class D> using C = D<int>;
// RUN: %clang_cc1 -fsyntax-only -verify %s
+// expected-no-diagnostics
struct mystruct {
int member;
// RUN: %clang_cc1 -fsyntax-only -verify %s
+// expected-no-diagnostics
// PR8345
template<typename T> T f(T* value) {
// RUN: %clang_cc1 -fsyntax-only -std=c++11 -verify %s
+// expected-no-diagnostics
// Test default template arguments for function templates.
template<typename T = int>
// RUN: %clang_cc1 -fsyntax-only -verify %s
+// expected-no-diagnostics
// PR4381
template<class T> struct X {};
// RUN: %clang_cc1 -fsyntax-only -verify %s
+// expected-no-diagnostics
// PR5908
template <typename Iterator>
// RUN: %clang_cc1 -fsyntax-only -verify %s
+// expected-no-diagnostics
enum Enum { val = 1 };
template <Enum v> struct C {
// RUN: %clang_cc1 -fsyntax-only -verify %s
+// expected-no-diagnostics
// A simple cons-style typelist
struct nil { };
// RUN: %clang_cc1 -fsyntax-only -verify %s -std=c++11
+// expected-no-diagnostics
#ifndef __GXX_EXPERIMENTAL_CXX0X__
#define __CONCAT(__X, __Y) __CONCAT1(__X, __Y)
// RUN: %clang_cc1 -fsyntax-only -verify %s
+// expected-no-diagnostics
template <typename T>
struct A {
char a __attribute__((aligned(16)));
// RUN: %clang_cc1 -fsyntax-only -verify %s
+// expected-no-diagnostics
// PR5426 - the non-dependent obj would be fully processed and wrapped in a
// CXXConstructExpr at definition time, which would lead to a failure at
// RUN: %clang_cc1 -fsyntax-only -verify %s
+// expected-no-diagnostics
template<int i> struct x {
static const int j = i;
x<j>* y;
// RUN: %clang_cc1 -fsyntax-only -Wall -verify %s
+// expected-no-diagnostics
template<typename a> struct A {
template <typename b> struct B {
template <typename c> struct C {
// RUN: %clang_cc1 -fsyntax-only -verify %s
+// expected-no-diagnostics
// PR4382
template<typename T> struct X { static const T A = 1; };
template<typename T, bool = X<T>::A> struct Y { typedef T A; };
// RUN: %clang_cc1 -fsyntax-only -verify %s
+// expected-no-diagnostics
// PR5681
template <class T> struct Base {
// RUN: %clang_cc1 %s -fsyntax-only -verify
+// expected-no-diagnostics
template<int IntBits> struct X {
enum {
// RUN: %clang_cc1 -fsyntax-only -verify %s
+// expected-no-diagnostics
// PR4794
template <class T> class X
// RUN: %clang_cc1 -verify %s
+// expected-no-diagnostics
template<typename T>
void f0() {
struct X;
// RUN: %clang_cc1 -fsyntax-only -verify %s
+// expected-no-diagnostics
// PR5311
template<typename T>
// RUN: %clang_cc1 -fsyntax-only -verify %s
+// expected-no-diagnostics
// PR5488
struct X {
// RUN: %clang_cc1 -fsyntax-only -verify -std=c++11 %s
+// expected-no-diagnostics
// Make sure we handle contexts correctly with sizeof
template<typename T> void f(T n) {
// RUN: %clang_cc1 -fsyntax-only -verify %s
+// expected-no-diagnostics
template<typename T> struct A { };
// RUN: %clang_cc1 -fsyntax-only -verify %s
+// expected-no-diagnostics
// Core issue 150: Template template parameters and default arguments
// RUN: %clang_cc1 -fms-extensions -fsyntax-only -verify %s
+// expected-no-diagnostics
class C {
public:
// RUN: %clang_cc1 -fsyntax-only -verify %s
+// expected-no-diagnostics
template<typename T> struct A {
A() : j(10), i(10) { }
// RUN: %clang_cc1 -fsyntax-only -verify %s
+// expected-no-diagnostics
extern "C" { extern "C++" { template<class C> C x(); } }
// RUN: %clang_cc1 -fsyntax-only -verify %s
+// expected-no-diagnostics
template<typename T>
struct A {
// RUN: %clang_cc1 -fsyntax-only -verify -Wno-unused %s
+// expected-no-diagnostics
// Tests that overload resolution is treated as an unevaluated context.
// PR5541
// RUN: %clang_cc1 -fsyntax-only -verify -triple i686-apple-osx10.7.0 %s
+// expected-no-diagnostics
#pragma ms_struct on
// RUN: %clang_cc1 -fsyntax-only -verify %s -fblocks
+// expected-no-diagnostics
template<typename T>
struct is_unary_block {
static const bool value = false;
// RUN: %clang_cc1 -fsyntax-only -verify %s
+// expected-no-diagnostics
#define T(b) (b) ? 1 : -1
#define F(b) (b) ? -1 : 1
// RUN: %clang_cc1 -fsyntax-only -verify %s
+// expected-no-diagnostics
template<typename T>
struct Base {
// RUN: %clang_cc1 -std=c++11 -fsyntax-only -verify %s
+// expected-no-diagnostics
class A
{
public: