diff options
Diffstat (limited to 'test/SemaCXX')
192 files changed, 544 insertions, 319 deletions
diff --git a/test/SemaCXX/PR5086-ambig-resolution-enum.cpp b/test/SemaCXX/PR5086-ambig-resolution-enum.cpp index 838bc6f3c716a..720566a69b055 100644 --- a/test/SemaCXX/PR5086-ambig-resolution-enum.cpp +++ b/test/SemaCXX/PR5086-ambig-resolution-enum.cpp @@ -1,4 +1,4 @@ -// RUN: clang-cc -fsyntax-only -verify %s -std=c++0x +// RUN: %clang_cc1 -fsyntax-only -verify %s -std=c++0x class C { public: diff --git a/test/SemaCXX/__null.cpp b/test/SemaCXX/__null.cpp index cf78514440927..3583655134a74 100644 --- a/test/SemaCXX/__null.cpp +++ b/test/SemaCXX/__null.cpp @@ -1,5 +1,5 @@ -// RUN: clang-cc -triple x86_64-unknown-unknown %s -fsyntax-only -verify -// RUN: clang-cc -triple i686-unknown-unknown %s -fsyntax-only -verify +// RUN: %clang_cc1 -triple x86_64-unknown-unknown %s -fsyntax-only -verify +// RUN: %clang_cc1 -triple i686-unknown-unknown %s -fsyntax-only -verify void f() { int* i = __null; diff --git a/test/SemaCXX/abstract.cpp b/test/SemaCXX/abstract.cpp index 3db607a365c09..0ae6c446f3da9 100644 --- a/test/SemaCXX/abstract.cpp +++ b/test/SemaCXX/abstract.cpp @@ -1,4 +1,4 @@ -// RUN: clang-cc -fsyntax-only -verify %s -std=c++0x +// RUN: %clang_cc1 -fsyntax-only -verify %s -std=c++0x #ifndef __GXX_EXPERIMENTAL_CXX0X__ #define __CONCAT(__X, __Y) __CONCAT1(__X, __Y) @@ -155,3 +155,17 @@ namespace PR5550 { }; C x; } + +namespace PureImplicit { + // A pure virtual destructor should be implicitly overridden. + struct A { virtual ~A() = 0; }; + struct B : A {}; + B x; + + // A pure virtual assignment operator should be implicitly overridden. + struct D; + struct C { virtual D& operator=(const D&) = 0; }; + struct D : C {}; + D y; +} + diff --git a/test/SemaCXX/access-base-class.cpp b/test/SemaCXX/access-base-class.cpp index 4a9ee51dbfb5b..f4c58d940b636 100644 --- a/test/SemaCXX/access-base-class.cpp +++ b/test/SemaCXX/access-base-class.cpp @@ -1,12 +1,11 @@ -// RUN: clang-cc -fsyntax-only -faccess-control -verify %s +// RUN: %clang_cc1 -fsyntax-only -faccess-control -verify %s namespace T1 { class A { }; class B : private A { }; // expected-note {{'private' inheritance specifier here}} void f(B* b) { - A *a = b; // expected-error{{conversion from 'class T1::B' to inaccessible base class 'class T1::A'}} \ - expected-error{{incompatible type initializing 'class T1::B *', expected 'class T1::A *'}} + A *a = b; // expected-error{{conversion from 'class T1::B' to inaccessible base class 'class T1::A'}} } } @@ -17,8 +16,7 @@ class A { }; class B : A { }; // expected-note {{inheritance is implicitly 'private'}} void f(B* b) { - A *a = b; // expected-error {{conversion from 'class T2::B' to inaccessible base class 'class T2::A'}} \ - expected-error {{incompatible type initializing 'class T2::B *', expected 'class T2::A *'}} + A *a = b; // expected-error {{conversion from 'class T2::B' to inaccessible base class 'class T2::A'}} } } @@ -71,8 +69,7 @@ namespace T6 { class C : public B { void f(C *c) { - A* a = c; // expected-error {{conversion from 'class T6::C' to inaccessible base class 'class T6::A'}} \ - expected-error {{incompatible type initializing 'class T6::C *', expected 'class T6::A *'}} + A* a = c; // expected-error {{conversion from 'class T6::C' to inaccessible base class 'class T6::A'}} } }; diff --git a/test/SemaCXX/access-control-check.cpp b/test/SemaCXX/access-control-check.cpp index fb124a932a121..e6e261c1a89f8 100644 --- a/test/SemaCXX/access-control-check.cpp +++ b/test/SemaCXX/access-control-check.cpp @@ -1,4 +1,4 @@ -// RUN: clang-cc -fsyntax-only -faccess-control -verify %s +// RUN: %clang_cc1 -fsyntax-only -faccess-control -verify %s class M { int iM; diff --git a/test/SemaCXX/access.cpp b/test/SemaCXX/access.cpp index cfbc9c80692b2..6115ff6a94f40 100644 --- a/test/SemaCXX/access.cpp +++ b/test/SemaCXX/access.cpp @@ -1,4 +1,4 @@ -// RUN: clang-cc -fsyntax-only -verify %s +// RUN: %clang_cc1 -fsyntax-only -verify %s class C { struct S; // expected-note {{previously declared 'private' here}} @@ -21,3 +21,14 @@ protected: private: template<typename T> struct A {}; // expected-error {{'A' redeclared with 'private' access}} }; + +// PR5573 +namespace test1 { + class A { + private: + class X; // expected-note {{previously declared 'private' here}} + public: + class X; // expected-error {{ 'X' redeclared with 'public' access}} + class X {}; + }; +} diff --git a/test/SemaCXX/addr-of-overloaded-function.cpp b/test/SemaCXX/addr-of-overloaded-function.cpp index 80ea02bafd412..3b06119393d00 100644 --- a/test/SemaCXX/addr-of-overloaded-function.cpp +++ b/test/SemaCXX/addr-of-overloaded-function.cpp @@ -1,4 +1,4 @@ -// RUN: clang-cc -fsyntax-only -verify %s +// RUN: %clang_cc1 -fsyntax-only -verify %s int f(double); int f(int); @@ -9,7 +9,7 @@ int (*pfi)(int) = &f; // selects f(int) // FIXME: This error message is not very good. We need to keep better // track of what went wrong when the implicit conversion failed to // give a better error message here. -int (*pfe)(...) = &f; // expected-error{{incompatible type initializing '<overloaded function type>', expected 'int (*)(...)'}} +int (*pfe)(...) = &f; // expected-error{{cannot initialize a variable of type 'int (*)(...)' with an rvalue of type '<overloaded function type>'}} int (&rfi)(int) = f; // selects f(int) int (&rfd)(double) = f; // selects f(double) diff --git a/test/SemaCXX/address-of.cpp b/test/SemaCXX/address-of.cpp index 4e436d6e98b2c..a7e712b04c1db 100644 --- a/test/SemaCXX/address-of.cpp +++ b/test/SemaCXX/address-of.cpp @@ -1,4 +1,4 @@ -// RUN: clang-cc -fsyntax-only -verify %s +// RUN: %clang_cc1 -fsyntax-only -verify %s // PR clang/3175 void bar(int*); diff --git a/test/SemaCXX/aggregate-initialization.cpp b/test/SemaCXX/aggregate-initialization.cpp index c96eda4480323..255b3529823ee 100644 --- a/test/SemaCXX/aggregate-initialization.cpp +++ b/test/SemaCXX/aggregate-initialization.cpp @@ -1,4 +1,4 @@ -// RUN: clang-cc -fsyntax-only -verify -std=c++98 %s +// RUN: %clang_cc1 -fsyntax-only -verify -std=c++98 %s // Verify that we can't initialize non-aggregates with an initializer // list. @@ -22,7 +22,7 @@ struct NonAggr4 { virtual void f(); }; -NonAggr1 na1 = { 17 }; // expected-error{{initialization of non-aggregate type 'struct NonAggr1' with an initializer list}} -NonAggr2 na2 = { 17 }; // expected-error{{initialization of non-aggregate type 'struct NonAggr2' with an initializer list}} -NonAggr3 na3 = { 17 }; // expected-error{{initialization of non-aggregate type 'class NonAggr3' with an initializer list}} -NonAggr4 na4 = { 17 }; // expected-error{{initialization of non-aggregate type 'struct NonAggr4' with an initializer list}} +NonAggr1 na1 = { 17 }; // expected-error{{non-aggregate type 'struct NonAggr1' cannot be initialized with an initializer list}} +NonAggr2 na2 = { 17 }; // expected-error{{non-aggregate type 'struct NonAggr2' cannot be initialized with an initializer list}} +NonAggr3 na3 = { 17 }; // expected-error{{non-aggregate type 'class NonAggr3' cannot be initialized with an initializer list}} +NonAggr4 na4 = { 17 }; // expected-error{{non-aggregate type 'struct NonAggr4' cannot be initialized with an initializer list}} diff --git a/test/SemaCXX/alignof-sizeof-reference.cpp b/test/SemaCXX/alignof-sizeof-reference.cpp index 27d98ab6491e3..f02282d72d309 100644 --- a/test/SemaCXX/alignof-sizeof-reference.cpp +++ b/test/SemaCXX/alignof-sizeof-reference.cpp @@ -1,4 +1,4 @@ -// RUN: clang-cc -std=c++0x -fsyntax-only -verify %s +// RUN: %clang_cc1 -std=c++0x -fsyntax-only -verify %s struct s0; // expected-note {{forward declaration}} char ar[sizeof(s0&)]; // expected-error {{invalid application of 'sizeof' to an incomplete type}} diff --git a/test/SemaCXX/ambig-user-defined-conversions.cpp b/test/SemaCXX/ambig-user-defined-conversions.cpp index 94598f0e8ef2f..0820bc93c39f9 100644 --- a/test/SemaCXX/ambig-user-defined-conversions.cpp +++ b/test/SemaCXX/ambig-user-defined-conversions.cpp @@ -1,4 +1,4 @@ -// RUN: clang-cc -fsyntax-only -verify %s +// RUN: %clang_cc1 -fsyntax-only -verify %s // Test1 struct BASE { diff --git a/test/SemaCXX/ambiguous-builtin-unary-operator.cpp b/test/SemaCXX/ambiguous-builtin-unary-operator.cpp index 5affd19a2fdf0..1aa09a6827a0f 100644 --- a/test/SemaCXX/ambiguous-builtin-unary-operator.cpp +++ b/test/SemaCXX/ambiguous-builtin-unary-operator.cpp @@ -1,4 +1,4 @@ -// RUN: clang-cc -fsyntax-only -verify %s -std=c++0x +// RUN: %clang_cc1 -fsyntax-only -verify %s -std=c++0x struct A { operator int&(); diff --git a/test/SemaCXX/anonymous-union.cpp b/test/SemaCXX/anonymous-union.cpp index f77fa03328f61..374241c9e4e60 100644 --- a/test/SemaCXX/anonymous-union.cpp +++ b/test/SemaCXX/anonymous-union.cpp @@ -1,4 +1,4 @@ -// RUN: clang-cc -fsyntax-only -verify %s +// RUN: %clang_cc1 -fsyntax-only -verify %s struct X { union { float f3; diff --git a/test/SemaCXX/array-bound-merge.cpp b/test/SemaCXX/array-bound-merge.cpp index 579c7933684db..74f58fa123601 100644 --- a/test/SemaCXX/array-bound-merge.cpp +++ b/test/SemaCXX/array-bound-merge.cpp @@ -1,4 +1,4 @@ -// RUN: clang-cc -fsyntax-only -verify %s +// RUN: %clang_cc1 -fsyntax-only -verify %s // PR5515 extern int a[]; diff --git a/test/SemaCXX/arrow-operator.cpp b/test/SemaCXX/arrow-operator.cpp index 08b3cd4cc7169..fd1ec0120a71a 100644 --- a/test/SemaCXX/arrow-operator.cpp +++ b/test/SemaCXX/arrow-operator.cpp @@ -1,4 +1,4 @@ -// RUN: clang-cc -fsyntax-only -verify %s +// RUN: %clang_cc1 -fsyntax-only -verify %s struct T { void f(); }; diff --git a/test/SemaCXX/attr-after-definition.cpp b/test/SemaCXX/attr-after-definition.cpp index 2ef5acfbc0f15..148a63e4d6c1c 100644 --- a/test/SemaCXX/attr-after-definition.cpp +++ b/test/SemaCXX/attr-after-definition.cpp @@ -1,4 +1,4 @@ -// RUN: clang-cc -fsyntax-only -verify %s +// RUN: %clang_cc1 -fsyntax-only -verify %s struct X { }; struct Y { }; diff --git a/test/SemaCXX/attr-cxx0x.cpp b/test/SemaCXX/attr-cxx0x.cpp index d68779cc88869..9924d1bc5707b 100644 --- a/test/SemaCXX/attr-cxx0x.cpp +++ b/test/SemaCXX/attr-cxx0x.cpp @@ -1,4 +1,4 @@ -// RUN: clang-cc -fsyntax-only -verify -std=c++0x %s +// RUN: %clang_cc1 -fsyntax-only -verify -std=c++0x %s int final_fail [[final]]; //expected-error {{'final' attribute only applies to virtual method or class types}} diff --git a/test/SemaCXX/attr-deprecated.cpp b/test/SemaCXX/attr-deprecated.cpp index 54f8b5b57fcdc..d5662d3f6313c 100644 --- a/test/SemaCXX/attr-deprecated.cpp +++ b/test/SemaCXX/attr-deprecated.cpp @@ -1,4 +1,4 @@ -// RUN: clang-cc %s -verify -fsyntax-only +// RUN: %clang_cc1 %s -verify -fsyntax-only class A { void f() __attribute__((deprecated)); void g(A* a); diff --git a/test/SemaCXX/attr-format.cpp b/test/SemaCXX/attr-format.cpp index 369099a848002..0c1eb53ea07fb 100644 --- a/test/SemaCXX/attr-format.cpp +++ b/test/SemaCXX/attr-format.cpp @@ -1,4 +1,4 @@ -// RUN: clang-cc -fsyntax-only -verify %s +// RUN: %clang_cc1 -fsyntax-only -verify %s struct S { static void f(const char*, ...) __attribute__((format(printf, 1, 2))); diff --git a/test/SemaCXX/attr-noreturn.cpp b/test/SemaCXX/attr-noreturn.cpp index e4fdc08ae9e7b..b7d39992b8fb1 100644 --- a/test/SemaCXX/attr-noreturn.cpp +++ b/test/SemaCXX/attr-noreturn.cpp @@ -1,4 +1,4 @@ -// RUN: clang-cc -fsyntax-only -verify %s +// RUN: %clang_cc1 -fsyntax-only -verify %s // PR5620 void f0() __attribute__((__noreturn__)); @@ -28,3 +28,12 @@ void test_f3() { f3(f0); // okay f3(f2); // expected-error{{no matching function for call}} } + + +class xpto { + int blah() __attribute__((noreturn)); +}; + +int xpto::blah() { + return 3; // expected-warning {{function 'blah' declared 'noreturn' should not return}} +} diff --git a/test/SemaCXX/attr-sentinel.cpp b/test/SemaCXX/attr-sentinel.cpp index 0293a5dce00c6..56c8f881600b9 100644 --- a/test/SemaCXX/attr-sentinel.cpp +++ b/test/SemaCXX/attr-sentinel.cpp @@ -1,4 +1,4 @@ -// RUN: clang-cc -fsyntax-only -verify %s +// RUN: %clang_cc1 -fsyntax-only -verify %s void f(int, ...) __attribute__((sentinel)); void g() { diff --git a/test/SemaCXX/attr-unavailable.cpp b/test/SemaCXX/attr-unavailable.cpp index 8e5f76bcacfa7..bebd4cb18e5da 100644 --- a/test/SemaCXX/attr-unavailable.cpp +++ b/test/SemaCXX/attr-unavailable.cpp @@ -1,4 +1,4 @@ -// RUN: clang-cc -fsyntax-only -verify %s +// RUN: %clang_cc1 -fsyntax-only -verify %s int &foo(int); double &foo(double); diff --git a/test/SemaCXX/auto-cxx0x.cpp b/test/SemaCXX/auto-cxx0x.cpp index aa92bbe4f1f17..654acb5ad20c3 100644 --- a/test/SemaCXX/auto-cxx0x.cpp +++ b/test/SemaCXX/auto-cxx0x.cpp @@ -1,4 +1,4 @@ -// RUN: clang-cc -fsyntax-only -verify %s -std=c++0x +// RUN: %clang_cc1 -fsyntax-only -verify %s -std=c++0x void f() { auto int a; // expected-error{{cannot combine with previous 'auto' declaration specifier}} // expected-error{{declaration of variable 'a' with type 'auto' requires an initializer}} int auto b; // expected-error{{cannot combine with previous 'int' declaration specifier}} diff --git a/test/SemaCXX/auto-cxx98.cpp b/test/SemaCXX/auto-cxx98.cpp index 14670cd699421..fe028114880a3 100644 --- a/test/SemaCXX/auto-cxx98.cpp +++ b/test/SemaCXX/auto-cxx98.cpp @@ -1,4 +1,4 @@ -// RUN: clang-cc -fsyntax-only -verify %s -std=c++98 +// RUN: %clang_cc1 -fsyntax-only -verify %s -std=c++98 void f() { auto int a; int auto b; diff --git a/test/SemaCXX/blocks.cpp b/test/SemaCXX/blocks.cpp index 9d789bb3252ad..94295437e1614 100644 --- a/test/SemaCXX/blocks.cpp +++ b/test/SemaCXX/blocks.cpp @@ -1,4 +1,4 @@ -// RUN: clang-cc -fsyntax-only -verify %s -fblocks +// RUN: %clang_cc1 -fsyntax-only -verify %s -fblocks void tovoid(void*); diff --git a/test/SemaCXX/bool.cpp b/test/SemaCXX/bool.cpp index 259c09c6cb833..44e17ce62b793 100644 --- a/test/SemaCXX/bool.cpp +++ b/test/SemaCXX/bool.cpp @@ -1,4 +1,4 @@ -// RUN: clang-cc -fsyntax-only -verify %s +// RUN: %clang_cc1 -fsyntax-only -verify %s // Bool literals can be enum values. enum { @@ -14,7 +14,7 @@ void test(bool b) --b; // expected-error {{cannot decrement expression of type bool}} b--; // expected-error {{cannot decrement expression of type bool}} - bool *b1 = (int *)0; // expected-error{{expected 'bool *'}} + bool *b1 = (int *)0; // expected-error{{cannot initialize}} } // static_assert_arg_is_bool(x) compiles only if x is a bool. diff --git a/test/SemaCXX/builtin-ptrtomember-ambig.cpp b/test/SemaCXX/builtin-ptrtomember-ambig.cpp index 1b52651910d95..3e0dfbb48edaa 100644 --- a/test/SemaCXX/builtin-ptrtomember-ambig.cpp +++ b/test/SemaCXX/builtin-ptrtomember-ambig.cpp @@ -1,4 +1,4 @@ -// RUN: clang-cc -fsyntax-only -verify %s -std=c++0x +// RUN: %clang_cc1 -fsyntax-only -verify %s -std=c++0x struct A {}; diff --git a/test/SemaCXX/builtin-ptrtomember-overload-1.cpp b/test/SemaCXX/builtin-ptrtomember-overload-1.cpp index 27ca6dc77897d..137503b2a4e0c 100644 --- a/test/SemaCXX/builtin-ptrtomember-overload-1.cpp +++ b/test/SemaCXX/builtin-ptrtomember-overload-1.cpp @@ -1,4 +1,4 @@ -// RUN: clang-cc -fsyntax-only -verify %s -std=c++0x +// RUN: %clang_cc1 -fsyntax-only -verify %s -std=c++0x struct A {}; struct E {}; diff --git a/test/SemaCXX/builtin-ptrtomember-overload.cpp b/test/SemaCXX/builtin-ptrtomember-overload.cpp index ed52d47f2cda7..6c132366199be 100644 --- a/test/SemaCXX/builtin-ptrtomember-overload.cpp +++ b/test/SemaCXX/builtin-ptrtomember-overload.cpp @@ -1,4 +1,4 @@ -// RUN: clang-cc -fsyntax-only -verify %s -std=c++0x +// RUN: %clang_cc1 -fsyntax-only -verify %s -std=c++0x struct A {}; diff --git a/test/SemaCXX/builtins.cpp b/test/SemaCXX/builtins.cpp index 9e9d1522f4f63..a75b4f2e403a8 100644 --- a/test/SemaCXX/builtins.cpp +++ b/test/SemaCXX/builtins.cpp @@ -1,7 +1,7 @@ -// RUN: clang-cc %s -fsyntax-only -verify +// RUN: %clang_cc1 %s -fsyntax-only -verify typedef const struct __CFString * CFStringRef; #define CFSTR __builtin___CFStringMakeConstantString void f() { (void)CFStringRef(CFSTR("Hello")); -}
\ No newline at end of file +} diff --git a/test/SemaCXX/c99.cpp b/test/SemaCXX/c99.cpp index b0ee056ef379e..f4c3639e16a90 100644 --- a/test/SemaCXX/c99.cpp +++ b/test/SemaCXX/c99.cpp @@ -1,4 +1,4 @@ -// RUN: clang-cc -fsyntax-only -verify %s +// RUN: %clang_cc1 -fsyntax-only -verify %s void f0(int i) { char array[i]; // expected-error{{variable length arrays}} diff --git a/test/SemaCXX/cast-conversion.cpp b/test/SemaCXX/cast-conversion.cpp index 3b6a9d6f8c492..77f4a528906d6 100644 --- a/test/SemaCXX/cast-conversion.cpp +++ b/test/SemaCXX/cast-conversion.cpp @@ -1,4 +1,4 @@ -// RUN: clang-cc -fsyntax-only -verify %s -std=c++0x +// RUN: %clang_cc1 -fsyntax-only -verify %s -std=c++0x struct R { R(int); diff --git a/test/SemaCXX/cast-explicit-ctor.cpp b/test/SemaCXX/cast-explicit-ctor.cpp index 62134ae658dbf..0052856d2ff92 100644 --- a/test/SemaCXX/cast-explicit-ctor.cpp +++ b/test/SemaCXX/cast-explicit-ctor.cpp @@ -1,4 +1,4 @@ -// RUN: clang-cc -fsyntax-only -verify %s +// RUN: %clang_cc1 -fsyntax-only -verify %s struct B { explicit B(bool); }; void f() { (void)(B)true; diff --git a/test/SemaCXX/class-base-member-init.cpp b/test/SemaCXX/class-base-member-init.cpp index 2092847bc02d5..67bc43c2e80be 100644 --- a/test/SemaCXX/class-base-member-init.cpp +++ b/test/SemaCXX/class-base-member-init.cpp @@ -1,4 +1,4 @@ -// RUN: clang-cc -fsyntax-only -verify %s +// RUN: %clang_cc1 -fsyntax-only -verify %s class S { public: diff --git a/test/SemaCXX/class-layout.cpp b/test/SemaCXX/class-layout.cpp index b5971723a70d7..2b8d1d3210b34 100644 --- a/test/SemaCXX/class-layout.cpp +++ b/test/SemaCXX/class-layout.cpp @@ -1,4 +1,4 @@ -// RUN: clang-cc -triple x86_64-unknown-unknown %s -fsyntax-only -verify +// RUN: %clang_cc1 -triple x86_64-unknown-unknown %s -fsyntax-only -verify #define SA(n, p) int a##n[(p) ? 1 : -1] diff --git a/test/SemaCXX/class-names.cpp b/test/SemaCXX/class-names.cpp index da9014574d2c9..2962988bec5b7 100644 --- a/test/SemaCXX/class-names.cpp +++ b/test/SemaCXX/class-names.cpp @@ -1,4 +1,4 @@ -// RUN: clang-cc -fsyntax-only -verify %s +// RUN: %clang_cc1 -fsyntax-only -verify %s class C { }; C c; diff --git a/test/SemaCXX/class.cpp b/test/SemaCXX/class.cpp index 2637f320207f8..743983cd34619 100644 --- a/test/SemaCXX/class.cpp +++ b/test/SemaCXX/class.cpp @@ -1,4 +1,4 @@ -// RUN: clang-cc -fsyntax-only -verify %s +// RUN: %clang_cc1 -fsyntax-only -verify %s class C { public: auto int errx; // expected-error {{error: storage class specified for a member declaration}} diff --git a/test/SemaCXX/compare.cpp b/test/SemaCXX/compare.cpp index 7188678b74db8..cd243e3d6b23f 100644 --- a/test/SemaCXX/compare.cpp +++ b/test/SemaCXX/compare.cpp @@ -1,7 +1,7 @@ // Force x86-64 because some of our heuristics are actually based // on integer sizes. -// RUN: clang-cc -triple x86_64-apple-darwin -fsyntax-only -pedantic -verify -Wsign-compare %s +// RUN: %clang_cc1 -triple x86_64-apple-darwin -fsyntax-only -pedantic -verify -Wsign-compare %s int test0(long a, unsigned long b) { enum EnumA {A}; diff --git a/test/SemaCXX/complex-overload.cpp b/test/SemaCXX/complex-overload.cpp index 55d3c76d06382..337875507245a 100644 --- a/test/SemaCXX/complex-overload.cpp +++ b/test/SemaCXX/complex-overload.cpp @@ -1,4 +1,4 @@ -// RUN: clang-cc -fsyntax-only -verify %s +// RUN: %clang_cc1 -fsyntax-only -verify %s char *foo(float); // expected-note 3 {{candidate function}} void test_foo_1(float fv, double dv, float _Complex fc, double _Complex dc) { diff --git a/test/SemaCXX/composite-pointer-type.cpp b/test/SemaCXX/composite-pointer-type.cpp index 1eec525f4834b..829e64f6c72ed 100644 --- a/test/SemaCXX/composite-pointer-type.cpp +++ b/test/SemaCXX/composite-pointer-type.cpp @@ -1,4 +1,4 @@ -// RUN: clang-cc -fsyntax-only -verify %s +// RUN: %clang_cc1 -fsyntax-only -verify %s class Base { }; class Derived1 : public Base { }; diff --git a/test/SemaCXX/condition.cpp b/test/SemaCXX/condition.cpp index b2645d4fe0fa6..a0b57e1baa53a 100644 --- a/test/SemaCXX/condition.cpp +++ b/test/SemaCXX/condition.cpp @@ -1,4 +1,4 @@ -// RUN: clang-cc -fsyntax-only -verify %s +// RUN: %clang_cc1 -fsyntax-only -verify %s void test() { int x; @@ -6,7 +6,7 @@ void test() { if (int x=0) ++x; typedef int arr[10]; - while (arr x=0) ; // expected-error {{an array type is not allowed here}} expected-error {{initialization with '{...}' expected for array}} + while (arr x=0) ; // expected-error {{an array type is not allowed here}} expected-error {{array initializer must be an initializer list}} while (int f()=0) ; // expected-error {{a function type is not allowed here}} struct S {} s; @@ -16,9 +16,9 @@ void test() { for (;s;) ; // expected-error {{value of type 'struct S' is not contextually convertible to 'bool'}} switch (s) {} // expected-error {{statement requires expression of integer type ('struct S' invalid)}} - while (struct S {} x=0) ; // expected-error {{types may not be defined in conditions}} expected-error {{cannot initialize 'x' with an rvalue of type 'int'}} expected-error {{value of type 'struct S' is not contextually convertible to 'bool'}} - while (struct {} x=0) ; // expected-error {{types may not be defined in conditions}} expected-error {{cannot initialize 'x' with an rvalue of type 'int'}} expected-error {{value of type 'struct <anonymous>' is not contextually convertible to 'bool'}} - switch (enum {E} x=0) ; // expected-error {{types may not be defined in conditions}} expected-error {{incompatible type}} + while (struct S {} x=0) ; // expected-error {{types may not be defined in conditions}} expected-error {{no viable conversion}} expected-error {{value of type 'struct S' is not contextually convertible to 'bool'}} expected-note{{candidate function}} + while (struct {} x=0) ; // expected-error {{types may not be defined in conditions}} expected-error {{no viable conversion}} expected-error {{value of type 'struct <anonymous>' is not contextually convertible to 'bool'}} expected-note{{candidate function}} + switch (enum {E} x=0) ; // expected-error {{types may not be defined in conditions}} expected-error {{cannot initialize}} if (int x=0) { // expected-note 2 {{previous definition is here}} int x; // expected-error {{redefinition of 'x'}} diff --git a/test/SemaCXX/conditional-expr.cpp b/test/SemaCXX/conditional-expr.cpp index f76472bf2f427..0617cd5702c65 100644 --- a/test/SemaCXX/conditional-expr.cpp +++ b/test/SemaCXX/conditional-expr.cpp @@ -1,4 +1,4 @@ -// RUN: clang-cc -fsyntax-only -verify -faccess-control -std=c++0x -Wsign-compare %s +// RUN: %clang_cc1 -fsyntax-only -verify -faccess-control -std=c++0x -Wsign-compare %s // C++ rules for ?: are a lot stricter than C rules, and have to take into // account more conversion options. @@ -25,7 +25,7 @@ struct Derived : Base { void fn2(); }; struct Convertible { operator Base&(); }; -struct Priv : private Base {}; // expected-note 2 {{'private' inheritance specifier here}} +struct Priv : private Base {}; // expected-note 4 {{'private' inheritance specifier here}} struct Mid : Base {}; struct Fin : Mid, Derived {}; typedef void (Derived::*DFnPtr)(); @@ -109,13 +109,12 @@ void test() (void)(i1 ? Base() : constder()); // expected-error {{incompatible operand types ('struct Base' and 'struct Derived const')}} (void)(i1 ? constder() : Base()); // expected-error {{incompatible operand types ('struct Derived const' and 'struct Base')}} - // FIXME: these are invalid hierarchy conversions Priv priv; Fin fin; - (void)(i1 ? Base() : Priv()); // xpected-error private base - (void)(i1 ? Priv() : Base()); // xpected-error private base - (void)(i1 ? Base() : Fin()); // xpected-error ambiguous base - (void)(i1 ? Fin() : Base()); // xpected-error ambiguous base + (void)(i1 ? Base() : Priv()); // expected-error{{conversion from 'struct Priv' to inaccessible base class 'struct Base'}} + (void)(i1 ? Priv() : Base()); // expected-error{{error: conversion from 'struct Priv' to inaccessible base class 'struct Base'}} + (void)(i1 ? Base() : Fin()); // expected-error{{ambiguous conversion from derived class 'struct Fin' to base class 'struct Base'}} + (void)(i1 ? Fin() : Base()); // expected-error{{ambiguous conversion from derived class 'struct Fin' to base class 'struct Base'}} (void)(i1 ? base : priv); // expected-error {{conversion from 'struct Priv' to inaccessible base class 'struct Base'}} (void)(i1 ? priv : base); // expected-error {{conversion from 'struct Priv' to inaccessible base class 'struct Base'}} (void)(i1 ? base : fin); // expected-error {{ambiguous conversion from derived class 'struct Fin' to base class 'struct Base'}} diff --git a/test/SemaCXX/const-cast.cpp b/test/SemaCXX/const-cast.cpp index ee0048bd73bee..220e6faeee3c4 100644 --- a/test/SemaCXX/const-cast.cpp +++ b/test/SemaCXX/const-cast.cpp @@ -1,4 +1,4 @@ -// RUN: clang-cc -fsyntax-only -verify %s +// RUN: %clang_cc1 -fsyntax-only -verify %s struct A {}; @@ -28,8 +28,9 @@ char ***good_const_cast_test(ccvpcvpp var) char ***&var4 = const_cast<cpppr>(var3); // Drop reference. Intentionally without qualifier change. char *** var5 = const_cast<cppp>(var4); + // Const array to array reference. const int ar[100] = {0}; - int (&rar)[100] = const_cast<iarr>(ar); // expected-error {{const_cast from 'int const [100]' to 'iarr' (aka 'iar &') is not allowed}} + int (&rar)[100] = const_cast<iarr>(ar); // Array decay. Intentionally without qualifier change. int *pi = const_cast<int*>(ar); f fp = 0; diff --git a/test/SemaCXX/constant-expression.cpp b/test/SemaCXX/constant-expression.cpp index 02ea802c7265a..0d4d387433001 100644 --- a/test/SemaCXX/constant-expression.cpp +++ b/test/SemaCXX/constant-expression.cpp @@ -1,4 +1,4 @@ -// RUN: clang-cc -fsyntax-only -verify -std=c++98 %s +// RUN: %clang_cc1 -fsyntax-only -verify -std=c++98 %s // C++ [expr.const]p1: // In several places, C++ requires expressions that evaluate to an integral diff --git a/test/SemaCXX/constructor-initializer.cpp b/test/SemaCXX/constructor-initializer.cpp index 43186013aaa67..67d4074cbcdc9 100644 --- a/test/SemaCXX/constructor-initializer.cpp +++ b/test/SemaCXX/constructor-initializer.cpp @@ -1,4 +1,4 @@ -// RUN: clang-cc -Wreorder -fsyntax-only -verify %s +// RUN: %clang_cc1 -Wreorder -fsyntax-only -verify %s class A { int m; A() : A::m(17) { } // expected-error {{member initializer 'm' does not name a non-static data member or base class}} diff --git a/test/SemaCXX/constructor-recovery.cpp b/test/SemaCXX/constructor-recovery.cpp index 50fdc9622e4c7..c1bb43628356e 100644 --- a/test/SemaCXX/constructor-recovery.cpp +++ b/test/SemaCXX/constructor-recovery.cpp @@ -1,10 +1,9 @@ -// RUN: clang-cc -fsyntax-only -verify %s +// RUN: %clang_cc1 -fsyntax-only -verify %s -struct C { // expected-note {{candidate function}} - virtual C() = 0; // expected-error{{constructor cannot be declared 'virtual'}} \ - expected-note {{candidate function}} +struct C { + virtual C() = 0; // expected-error{{constructor cannot be declared 'virtual'}} }; void f() { - C c; // expected-error {{call to constructor of 'c' is ambiguous}} + C c; } diff --git a/test/SemaCXX/constructor.cpp b/test/SemaCXX/constructor.cpp index 58d28b55184c3..9ef5c98e9e2cf 100644 --- a/test/SemaCXX/constructor.cpp +++ b/test/SemaCXX/constructor.cpp @@ -1,4 +1,4 @@ -// RUN: clang-cc -fsyntax-only -verify %s +// RUN: %clang_cc1 -fsyntax-only -verify %s typedef int INT; class Foo { diff --git a/test/SemaCXX/conversion-delete-expr.cpp b/test/SemaCXX/conversion-delete-expr.cpp index 708289c362dc0..2338778ebaac2 100644 --- a/test/SemaCXX/conversion-delete-expr.cpp +++ b/test/SemaCXX/conversion-delete-expr.cpp @@ -1,4 +1,4 @@ -// RUN: clang-cc -fsyntax-only -verify -std=c++0x %s +// RUN: %clang_cc1 -fsyntax-only -verify -std=c++0x %s // Test1 struct B { diff --git a/test/SemaCXX/conversion-function.cpp b/test/SemaCXX/conversion-function.cpp index c0c318ed33680..db322f4a3d34e 100644 --- a/test/SemaCXX/conversion-function.cpp +++ b/test/SemaCXX/conversion-function.cpp @@ -1,4 +1,4 @@ -// RUN: clang-cc -fsyntax-only -verify %s +// RUN: %clang_cc1 -fsyntax-only -verify %s class X { public: operator bool(); @@ -9,7 +9,7 @@ public: } float g() { - return operator float(); // expected-error{{no matching function for call to 'operator float'}} + return operator float(); // expected-error{{use of undeclared 'operator float'}} } }; @@ -56,14 +56,14 @@ public: // This used to crash Clang. struct Flip; -struct Flop { +struct Flop { // expected-note{{candidate function}} Flop(); - Flop(const Flip&); + Flop(const Flip&); // expected-note{{candidate function}} }; struct Flip { - operator Flop() const; + operator Flop() const; // expected-note{{candidate function}} }; -Flop flop = Flip(); // expected-error {{cannot initialize 'flop' with an rvalue of type 'struct Flip'}} +Flop flop = Flip(); // expected-error {{conversion from 'struct Flip' to 'struct Flop' is ambiguous}} // This tests that we don't add the second conversion declaration to the list of user conversions struct C { @@ -99,7 +99,7 @@ class AutoPtrRef { }; class AutoPtr { // FIXME: Using 'unavailable' since we do not have access control yet. // FIXME: The error message isn't so good. - AutoPtr(AutoPtr &) __attribute__((unavailable)); + AutoPtr(AutoPtr &) __attribute__((unavailable)); // expected-note{{explicitly marked}} public: AutoPtr(); @@ -115,9 +115,19 @@ AutoPtr test_auto_ptr(bool Cond) { AutoPtr p; if (Cond) - return p; // expected-error{{incompatible type returning}} + return p; // expected-error{{call to deleted constructor}} return AutoPtr(); } +struct A1 { + A1(const char *); + ~A1(); +private: + A1(const A1&) __attribute__((unavailable)); // expected-note{{here}} +}; + +A1 f() { + return "Hello"; // expected-error{{invokes deleted copy constructor}} +} diff --git a/test/SemaCXX/convert-to-bool.cpp b/test/SemaCXX/convert-to-bool.cpp index 277bfc6c68884..4b5002e44a018 100644 --- a/test/SemaCXX/convert-to-bool.cpp +++ b/test/SemaCXX/convert-to-bool.cpp @@ -1,4 +1,4 @@ -// RUN: clang-cc -fsyntax-only -verify %s +// RUN: %clang_cc1 -fsyntax-only -verify %s struct ConvToBool { operator bool() const; }; @@ -44,7 +44,7 @@ struct ExplicitConvToRef { void test_explicit_bool(ExplicitConvToBool ecb) { bool b1(ecb); // okay - bool b2 = ecb; // expected-error{{incompatible type initializing 'struct ExplicitConvToBool', expected 'bool'}} + bool b2 = ecb; // expected-error{{no viable conversion from 'struct ExplicitConvToBool' to 'bool'}} accepts_bool(ecb); // expected-error{{no matching function for call to}} } diff --git a/test/SemaCXX/converting-constructor.cpp b/test/SemaCXX/converting-constructor.cpp index 3f347b49022ef..e78798b82cb76 100644 --- a/test/SemaCXX/converting-constructor.cpp +++ b/test/SemaCXX/converting-constructor.cpp @@ -1,4 +1,4 @@ -// RUN: clang-cc -fsyntax-only -verify %s +// RUN: %clang_cc1 -fsyntax-only -verify %s class Z { }; class Y { @@ -27,7 +27,7 @@ public: FromShort(short s); }; -class FromShortExplicitly { +class FromShortExplicitly { // expected-note{{candidate function}} public: explicit FromShortExplicitly(short s); }; @@ -36,7 +36,7 @@ void explicit_constructor(short s) { FromShort fs1(s); FromShort fs2 = s; FromShortExplicitly fse1(s); - FromShortExplicitly fse2 = s; // expected-error{{error: cannot initialize 'fse2' with an lvalue of type 'short'}} + FromShortExplicitly fse2 = s; // expected-error{{no viable conversion}} } // PR5519 diff --git a/test/SemaCXX/copy-assignment.cpp b/test/SemaCXX/copy-assignment.cpp index 413e4d1933676..315e29a5b5ec0 100644 --- a/test/SemaCXX/copy-assignment.cpp +++ b/test/SemaCXX/copy-assignment.cpp @@ -1,4 +1,4 @@ -// RUN: clang-cc -fsyntax-only -verify %s +// RUN: %clang_cc1 -fsyntax-only -verify %s struct A { }; diff --git a/test/SemaCXX/copy-constructor-error.cpp b/test/SemaCXX/copy-constructor-error.cpp index 2e42fcc3b1cd8..9cae77504b514 100644 --- a/test/SemaCXX/copy-constructor-error.cpp +++ b/test/SemaCXX/copy-constructor-error.cpp @@ -1,13 +1,12 @@ -// RUN: clang-cc -fsyntax-only -verify %s +// RUN: %clang_cc1 -fsyntax-only -verify %s -struct S { // expected-note {{candidate function}} - S (S); // expected-error {{copy constructor must pass its first argument by reference}} \\ - // expected-note {{candidate function}} +struct S { + S (S); // expected-error {{copy constructor must pass its first argument by reference}} }; S f(); void g() { - S a( f() ); // expected-error {{call to constructor of 'a' is ambiguous}} + S a( f() ); } diff --git a/test/SemaCXX/copy-initialization.cpp b/test/SemaCXX/copy-initialization.cpp index 5b1fbaa46052e..ad149232a4e36 100644 --- a/test/SemaCXX/copy-initialization.cpp +++ b/test/SemaCXX/copy-initialization.cpp @@ -1,18 +1,18 @@ -// RUN: clang-cc -fsyntax-only -verify %s +// RUN: %clang_cc1 -fsyntax-only -verify %s class X { public: explicit X(const X&); - X(int*); // expected-note{{candidate function}} + X(int*); // expected-note 2{{candidate function}} explicit X(float*); }; class Y : public X { }; void f(Y y, int *ip, float *fp) { - X x1 = y; // expected-error{{no matching constructor for initialization of 'x1'; candidate is:}} + X x1 = y; // expected-error{{no matching constructor for initialization of 'class X'}} X x2 = 0; X x3 = ip; - X x4 = fp; // expected-error{{cannot initialize 'x4' with an lvalue of type 'float *'}} + X x4 = fp; // expected-error{{no viable conversion}} } struct foo { diff --git a/test/SemaCXX/cstyle-cast.cpp b/test/SemaCXX/cstyle-cast.cpp index 9c47df927e7b3..dbb1e4a18a2ec 100644 --- a/test/SemaCXX/cstyle-cast.cpp +++ b/test/SemaCXX/cstyle-cast.cpp @@ -1,4 +1,4 @@ -// RUN: clang-cc -fsyntax-only -verify -faccess-control %s +// RUN: %clang_cc1 -fsyntax-only -verify -faccess-control %s struct A {}; diff --git a/test/SemaCXX/cxx-member-pointer-op.cpp b/test/SemaCXX/cxx-member-pointer-op.cpp index 63b29c723e072..f43d438eb46fc 100644 --- a/test/SemaCXX/cxx-member-pointer-op.cpp +++ b/test/SemaCXX/cxx-member-pointer-op.cpp @@ -1,4 +1,4 @@ -// RUN: clang-cc -fsyntax-only -pedantic -verify %s +// RUN: %clang_cc1 -fsyntax-only -pedantic -verify %s struct C { static int (C::* a); diff --git a/test/SemaCXX/dcl_ambig_res.cpp b/test/SemaCXX/dcl_ambig_res.cpp index 495a6e6e42c85..859d2045da099 100644 --- a/test/SemaCXX/dcl_ambig_res.cpp +++ b/test/SemaCXX/dcl_ambig_res.cpp @@ -1,4 +1,4 @@ -// RUN: clang-cc -fsyntax-only -pedantic -verify %s +// RUN: %clang_cc1 -fsyntax-only -pedantic -verify %s // [dcl.ambig.res]p1: struct S { diff --git a/test/SemaCXX/dcl_init_aggr.cpp b/test/SemaCXX/dcl_init_aggr.cpp index 20b787a225263..87b51e32e5cf3 100644 --- a/test/SemaCXX/dcl_init_aggr.cpp +++ b/test/SemaCXX/dcl_init_aggr.cpp @@ -1,4 +1,4 @@ -// RUN: clang-cc -fsyntax-only -pedantic -verify %s +// RUN: %clang_cc1 -fsyntax-only -pedantic -verify %s // C++ [dcl.init.aggr]p2 struct A { int x; @@ -13,7 +13,7 @@ struct NonAggregate { int a, b; }; -NonAggregate non_aggregate_test = { 1, 2 }; // expected-error{{initialization of non-aggregate type 'struct NonAggregate' with an initializer list}} +NonAggregate non_aggregate_test = { 1, 2 }; // expected-error{{non-aggregate type 'struct NonAggregate' cannot be initialized with an initializer list}} NonAggregate non_aggregate_test2[2] = { { 1, 2 }, { 3, 4 } }; // expected-error 2 {{initialization of non-aggregate type 'struct NonAggregate' with an initializer list}} @@ -40,17 +40,18 @@ char cv[4] = { 'a', 's', 'd', 'f', 0 }; // expected-error{{excess elements in ar struct TooFew { int a; char* b; int c; }; TooFew too_few = { 1, "asdf" }; // okay -struct NoDefaultConstructor { // expected-note 3 {{candidate function}} +struct NoDefaultConstructor { // expected-note 3 {{candidate function}} \ + // expected-note{{declared here}} NoDefaultConstructor(int); // expected-note 3 {{candidate function}} }; -struct TooFewError { +struct TooFewError { // expected-error{{implicit default constructor for}} int a; - NoDefaultConstructor nodef; + NoDefaultConstructor nodef; // expected-note{{member is declared here}} }; TooFewError too_few_okay = { 1, 1 }; TooFewError too_few_error = { 1 }; // expected-error{{no matching constructor}} -TooFewError too_few_okay2[2] = { 1, 1 }; +TooFewError too_few_okay2[2] = { 1, 1 }; // expected-note{{implicit default constructor for 'struct TooFewError' first required here}} TooFewError too_few_error2[2] = { 1 }; // expected-error{{no matching constructor}} NoDefaultConstructor too_few_error3[3] = { }; // expected-error {{no matching constructor}} @@ -114,9 +115,9 @@ B2 b2_2 = { 4, d2, 0 }; B2 b2_3 = { c2, a2, a2 }; // C++ [dcl.init.aggr]p15: -union u { int a; char* b; }; +union u { int a; char* b; }; // expected-note{{candidate function}} u u1 = { 1 }; u u2 = u1; -u u3 = 1; // expected-error{{cannot initialize 'u3' with an rvalue of type 'int'}} +u u3 = 1; // expected-error{{no viable conversion}} u u4 = { 0, "asdf" }; // expected-error{{excess elements in union initializer}} u u5 = { "asdf" }; // expected-error{{incompatible type initializing 'char const [5]', expected 'int'}} diff --git a/test/SemaCXX/decl-expr-ambiguity.cpp b/test/SemaCXX/decl-expr-ambiguity.cpp index 8d34a9ee7df99..81f68392d85aa 100644 --- a/test/SemaCXX/decl-expr-ambiguity.cpp +++ b/test/SemaCXX/decl-expr-ambiguity.cpp @@ -1,4 +1,4 @@ -// RUN: clang-cc -fsyntax-only -verify -pedantic-errors %s +// RUN: %clang_cc1 -fsyntax-only -verify -pedantic-errors %s void f() { int a; diff --git a/test/SemaCXX/decl-init-ref.cpp b/test/SemaCXX/decl-init-ref.cpp index 20eb91a608cad..294543f495dbd 100644 --- a/test/SemaCXX/decl-init-ref.cpp +++ b/test/SemaCXX/decl-init-ref.cpp @@ -1,4 +1,4 @@ -// RUN: clang-cc -fsyntax-only -verify -std=c++0x %s +// RUN: %clang_cc1 -fsyntax-only -verify -std=c++0x %s struct A {}; // expected-note {{candidate function}} @@ -18,9 +18,9 @@ class B : public BASE , public BASE1 extern B f(); -const int& ri = (void)0; // expected-error {{invalid initialization of reference of type 'int const &' from expression of type 'void'}} +const int& ri = (void)0; // expected-error {{reference to type 'int const' could not bind to an rvalue of type 'void'}} int main() { - const A& rca = f(); // expected-error {{conversion from 'class B' to 'struct A const' is ambiguous}} + const A& rca = f(); // expected-error {{reference initialization of type 'struct A const &' with initializer of type 'class B' is ambiguous}} A& ra = f(); // expected-error {{non-const lvalue reference to type 'struct A' cannot bind to a temporary of type 'class B'}} } diff --git a/test/SemaCXX/decltype-crash.cpp b/test/SemaCXX/decltype-crash.cpp index b56a7f602987f..f94ba453ffb4a 100644 --- a/test/SemaCXX/decltype-crash.cpp +++ b/test/SemaCXX/decltype-crash.cpp @@ -1,7 +1,7 @@ -// RUN: clang-cc -fsyntax-only -verify %s +// RUN: %clang_cc1 -fsyntax-only -verify %s int& a(); void f() { - decltype(a()) c; // expected-error {{no matching function for call to 'decltype'}} + decltype(a()) c; // expected-error {{use of undeclared identifier 'decltype'}} } diff --git a/test/SemaCXX/decltype-overloaded-functions.cpp b/test/SemaCXX/decltype-overloaded-functions.cpp index 4c5349b858681..906e868a42821 100644 --- a/test/SemaCXX/decltype-overloaded-functions.cpp +++ b/test/SemaCXX/decltype-overloaded-functions.cpp @@ -1,11 +1,11 @@ -// RUN: clang-cc -fsyntax-only -verify %s -std=c++0x +// RUN: %clang_cc1 -fsyntax-only -verify %s -std=c++0x void f(); void f(int); -decltype(f) a; // expected-error{{can't determine the declared type of an overloaded function}} +decltype(f) a; // expected-error{{cannot determine the declared type of an overloaded function}} template<typename T> struct S { - decltype(T::f) * f; // expected-error{{can't determine the declared type of an overloaded function}} + decltype(T::f) * f; // expected-error{{cannot determine the declared type of an overloaded function}} }; struct K { void f(); void f(int); }; diff --git a/test/SemaCXX/decltype-pr4444.cpp b/test/SemaCXX/decltype-pr4444.cpp index 8b2f584d24dd5..456b22c5f7f23 100644 --- a/test/SemaCXX/decltype-pr4444.cpp +++ b/test/SemaCXX/decltype-pr4444.cpp @@ -1,4 +1,4 @@ -// RUN: clang-cc -fsyntax-only -verify %s -std=c++0x +// RUN: %clang_cc1 -fsyntax-only -verify %s -std=c++0x template<typename T, T t> struct TestStruct { diff --git a/test/SemaCXX/decltype-pr4448.cpp b/test/SemaCXX/decltype-pr4448.cpp index fbf5da1d53eab..ead24ce0ca860 100644 --- a/test/SemaCXX/decltype-pr4448.cpp +++ b/test/SemaCXX/decltype-pr4448.cpp @@ -1,4 +1,4 @@ -// RUN: clang-cc -fsyntax-only -verify %s -std=c++0x +// RUN: %clang_cc1 -fsyntax-only -verify %s -std=c++0x template< typename T, T t, decltype(t+2) v > struct Convoluted {}; diff --git a/test/SemaCXX/decltype-this.cpp b/test/SemaCXX/decltype-this.cpp index c6bf299f3f3bf..f9bf49973b5c7 100644 --- a/test/SemaCXX/decltype-this.cpp +++ b/test/SemaCXX/decltype-this.cpp @@ -1,4 +1,4 @@ -// RUN: clang-cc -fsyntax-only -verify -std=c++0x %s +// RUN: %clang_cc1 -fsyntax-only -verify -std=c++0x %s template<typename T, typename U> struct is_same { static const bool value = false; diff --git a/test/SemaCXX/default-argument-temporaries.cpp b/test/SemaCXX/default-argument-temporaries.cpp index 232351dcff3db..3ab7bf4eb13d6 100644 --- a/test/SemaCXX/default-argument-temporaries.cpp +++ b/test/SemaCXX/default-argument-temporaries.cpp @@ -1,4 +1,4 @@ -// RUN: clang-cc -fsyntax-only -verify %s +// RUN: %clang_cc1 -fsyntax-only -verify %s struct B { B(void* = 0); }; struct A { diff --git a/test/SemaCXX/default-assignment-operator.cpp b/test/SemaCXX/default-assignment-operator.cpp index 0377657a82d24..9c99ad594458b 100644 --- a/test/SemaCXX/default-assignment-operator.cpp +++ b/test/SemaCXX/default-assignment-operator.cpp @@ -1,4 +1,4 @@ -// RUN: clang-cc -fsyntax-only -verify %s +// RUN: %clang_cc1 -fsyntax-only -verify %s class Base { // expected-error {{cannot define the implicit default assignment operator for 'class Base'}} int &ref; // expected-note {{declared at}} diff --git a/test/SemaCXX/default-constructor-initializers.cpp b/test/SemaCXX/default-constructor-initializers.cpp index 6adcdca3e177b..4269991adecfe 100644 --- a/test/SemaCXX/default-constructor-initializers.cpp +++ b/test/SemaCXX/default-constructor-initializers.cpp @@ -1,4 +1,4 @@ -// RUN: clang-cc -fsyntax-only -verify %s +// RUN: %clang_cc1 -fsyntax-only -verify %s struct X1 { // has no implicit default constructor X1(int); diff --git a/test/SemaCXX/default1.cpp b/test/SemaCXX/default1.cpp index be264ad62b130..790208aa1d050 100644 --- a/test/SemaCXX/default1.cpp +++ b/test/SemaCXX/default1.cpp @@ -1,4 +1,4 @@ -// RUN: clang-cc -fsyntax-only -verify %s +// RUN: %clang_cc1 -fsyntax-only -verify %s void f(int i); void f(int i = 0); // expected-note {{previous definition is here}} void f(int i = 17); // expected-error {{redefinition of default argument}} @@ -14,7 +14,7 @@ void h(int i, int j = 2, int k = 3, int n);// expected-error {{missing default argument on parameter 'n'}} struct S { } s; -void i(int = s) { } // expected-error {{incompatible type}} +void i(int = s) { } // expected-error {{no viable conversion}} struct X { X(int); @@ -22,10 +22,10 @@ struct X { void j(X x = 17); -struct Y { +struct Y { // expected-note 2{{candidate}} explicit Y(int); }; -void k(Y y = 17); // expected-error{{cannot initialize 'y' with an rvalue of type 'int'}} +void k(Y y = 17); // expected-error{{no viable conversion}} -void kk(Y = 17); // expected-error{{cannot initialize a value of type 'struct Y' with an rvalue of type 'int'}} +void kk(Y = 17); // expected-error{{no viable conversion}} diff --git a/test/SemaCXX/default2.cpp b/test/SemaCXX/default2.cpp index 183452070da43..880255e4531b1 100644 --- a/test/SemaCXX/default2.cpp +++ b/test/SemaCXX/default2.cpp @@ -1,4 +1,4 @@ -// RUN: clang-cc -fsyntax-only -verify %s +// RUN: %clang_cc1 -fsyntax-only -verify %s void f(int i, int j, int k = 3); void f(int i, int j, int k); @@ -82,7 +82,7 @@ int Y::mem4(int i = a) // expected-error{{invalid use of nonstatic data member ' // constructors. class Z { public: - Z(Z&, int i = 17); // expected-note 2 {{candidate function}} + Z(Z&, int i = 17); // expected-note 3 {{candidate function}} void f(Z& z) { Z z2; // expected-error{{no matching constructor for initialization}} @@ -90,12 +90,12 @@ public: } void test_Z(const Z& z) { - Z z2(z); // expected-error{{no matching constructor for initialization of 'z2'}} + Z z2(z); // expected-error{{no matching constructor for initialization of 'class Z'}} } }; void test_Z(const Z& z) { - Z z2(z); // expected-error{{no matching constructor for initialization of 'z2'}} + Z z2(z); // expected-error{{no matching constructor for initialization of 'class Z'}} } struct ZZ { diff --git a/test/SemaCXX/deleted-function.cpp b/test/SemaCXX/deleted-function.cpp index 637b2b1b2d5c9..d9df1bf5b05ac 100644 --- a/test/SemaCXX/deleted-function.cpp +++ b/test/SemaCXX/deleted-function.cpp @@ -1,4 +1,4 @@ -// RUN: clang-cc -fsyntax-only -verify -std=c++0x %s +// RUN: %clang_cc1 -fsyntax-only -verify -std=c++0x %s int i = delete; // expected-error {{only functions can have deleted definitions}} @@ -16,9 +16,9 @@ void ov(int) {} // expected-note {{candidate function}} void ov(double) = delete; // expected-note {{candidate function has been explicitly deleted}} struct WithDel { - WithDel() = delete; // expected-note {{candidate function has been explicitly deleted}} + WithDel() = delete; // expected-note {{function has been explicitly marked deleted here}} void fn() = delete; // expected-note {{function has been explicitly marked deleted here}} - operator int() = delete; + operator int() = delete; // expected-note {{function has been explicitly marked deleted here}} void operator +(int) = delete; int i = delete; // expected-error {{only functions can have deleted definitions}} @@ -29,8 +29,8 @@ void test() { ov(1); ov(1.0); // expected-error {{call to deleted function 'ov'}} - WithDel dd; // expected-error {{call to deleted constructor of 'dd'}} + WithDel dd; // expected-error {{call to deleted constructor of 'struct WithDel'}} WithDel *d = 0; d->fn(); // expected-error {{attempt to use a deleted function}} - int i = *d; // expected-error {{incompatible type initializing}} + int i = *d; // expected-error {{invokes a deleted function}} } diff --git a/test/SemaCXX/dependent-types.cpp b/test/SemaCXX/dependent-types.cpp index 300312580a8fd..d9b53230c9947 100644 --- a/test/SemaCXX/dependent-types.cpp +++ b/test/SemaCXX/dependent-types.cpp @@ -1,4 +1,4 @@ -// RUN: clang-cc -fsyntax-only -pedantic -verify %s +// RUN: %clang_cc1 -fsyntax-only -pedantic -verify %s template<typename T, int Size> void f() { T x1; diff --git a/test/SemaCXX/derived-to-base-ambig.cpp b/test/SemaCXX/derived-to-base-ambig.cpp index e15ddde9d91f0..cfcad7989aa23 100644 --- a/test/SemaCXX/derived-to-base-ambig.cpp +++ b/test/SemaCXX/derived-to-base-ambig.cpp @@ -1,4 +1,4 @@ -// RUN: clang-cc -fsyntax-only -verify %s +// RUN: %clang_cc1 -fsyntax-only -verify %s class A { }; class B : public A { }; class C : public A { }; diff --git a/test/SemaCXX/destructor.cpp b/test/SemaCXX/destructor.cpp index 790a401ae99c4..6837cd40157c7 100644 --- a/test/SemaCXX/destructor.cpp +++ b/test/SemaCXX/destructor.cpp @@ -1,4 +1,4 @@ -// RUN: clang-cc -fsyntax-only -verify %s +// RUN: %clang_cc1 -fsyntax-only -verify %s class A { public: ~A(); diff --git a/test/SemaCXX/direct-initializer.cpp b/test/SemaCXX/direct-initializer.cpp index a9e2b2bb6e456..03a5da3a303b2 100644 --- a/test/SemaCXX/direct-initializer.cpp +++ b/test/SemaCXX/direct-initializer.cpp @@ -1,4 +1,4 @@ -// RUN: clang-cc -fsyntax-only -verify %s +// RUN: %clang_cc1 -fsyntax-only -verify %s int x(1); int (x2)(1); @@ -20,19 +20,19 @@ public: X(float, Y); // expected-note{{candidate function}} }; -class Z { +class Z { // expected-note{{candidate function}} public: - Z(int); + Z(int); // expected-note{{candidate function}} }; void g() { X x1(5); X x2(1.0, 3, 4.2); - X x3(1.0, 1.0); // expected-error{{no matching constructor for initialization of 'x3'; candidates are:}} + X x3(1.0, 1.0); // expected-error{{no matching constructor for initialization of 'class X'}} Y y(1.0); X x4(3.14, y); - Z z; // expected-error{{no matching constructor for initialization of 'z'}} + Z z; // expected-error{{no matching constructor for initialization of 'class Z'}} } struct Base { @@ -40,11 +40,11 @@ struct Base { }; struct Derived : Base { - operator int*(); + operator int*(); // expected-note {{candidate function}} }; void foo(const Derived cd, Derived d) { - int *pi = cd; // expected-error {{incompatible type initializing 'struct Derived const', expected 'int *'}} + int *pi = cd; // expected-error {{no viable conversion from 'struct Derived const' to 'int *'}} int *ppi = d; } diff --git a/test/SemaCXX/do-while-scope.cpp b/test/SemaCXX/do-while-scope.cpp index 4e4a48325c1c6..2602ae12f243b 100644 --- a/test/SemaCXX/do-while-scope.cpp +++ b/test/SemaCXX/do-while-scope.cpp @@ -1,4 +1,4 @@ -// RUN: clang-cc -fsyntax-only -verify %s +// RUN: %clang_cc1 -fsyntax-only -verify %s void test() { int x; diff --git a/test/SemaCXX/dynamic-cast.cpp b/test/SemaCXX/dynamic-cast.cpp index 42c5e0132a82e..53d0b9d0189ce 100644 --- a/test/SemaCXX/dynamic-cast.cpp +++ b/test/SemaCXX/dynamic-cast.cpp @@ -1,4 +1,4 @@ -// RUN: clang-cc -fsyntax-only -verify %s +// RUN: %clang_cc1 -fsyntax-only -verify %s struct A {}; struct B : A {}; diff --git a/test/SemaCXX/elaborated-type-specifier.cpp b/test/SemaCXX/elaborated-type-specifier.cpp index 70478e0f32c47..8d2d67f705cdb 100644 --- a/test/SemaCXX/elaborated-type-specifier.cpp +++ b/test/SemaCXX/elaborated-type-specifier.cpp @@ -1,4 +1,4 @@ -// RUN: clang-cc -fsyntax-only -verify %s +// RUN: %clang_cc1 -fsyntax-only -verify %s // Test the use of elaborated-type-specifiers to inject the names of // structs (or classes or unions) into an outer scope as described in @@ -27,7 +27,7 @@ namespace NS { void test_X_elab(NS::X x) { struct S4 *s4 = 0; - x.test_elab2(s4); // expected-error{{incompatible type passing 'struct S4 *', expected 'struct NS::S4 *'}} + x.test_elab2(s4); // expected-error{{cannot initialize a parameter of type 'struct NS::S4 *' with an lvalue of type 'struct S4 *'}} } namespace NS { diff --git a/test/SemaCXX/empty-class-layout.cpp b/test/SemaCXX/empty-class-layout.cpp index 8b54ea1c66f28..c3dc7330fe765 100644 --- a/test/SemaCXX/empty-class-layout.cpp +++ b/test/SemaCXX/empty-class-layout.cpp @@ -1,4 +1,4 @@ -// RUN: clang-cc -triple x86_64-unknown-unknown %s -fsyntax-only -verify +// RUN: %clang_cc1 -triple x86_64-unknown-unknown %s -fsyntax-only -verify #define SA(n, p) int a##n[(p) ? 1 : -1] diff --git a/test/SemaCXX/enum.cpp b/test/SemaCXX/enum.cpp index 3315de00ca83e..f1b02f5d4c6db 100644 --- a/test/SemaCXX/enum.cpp +++ b/test/SemaCXX/enum.cpp @@ -1,4 +1,4 @@ -// RUN: clang-cc -fsyntax-only -verify %s +// RUN: %clang_cc1 -fsyntax-only -pedantic -std=c++98 -verify -triple x86_64-apple-darwin %s enum E { Val1, @@ -42,26 +42,17 @@ namespace test1 { template <class A> struct is_same<A,A> { static const int value = 1; }; enum enum0 { v0 }; - int test0[is_same<typeof(+v0), int>::value]; + int test0[is_same<__typeof(+v0), int>::value]; enum enum1 { v1 = __INT_MAX__ }; - int test1[is_same<typeof(+v1), int>::value]; + int test1[is_same<__typeof(+v1), int>::value]; enum enum2 { v2 = __INT_MAX__ * 2U }; - int test2[is_same<typeof(+v2), unsigned int>::value]; + int test2[is_same<__typeof(+v2), unsigned int>::value]; - // This kindof assumes that 'int' is smaller than 'long long'. -#if defined(__LP64__) - enum enum3 { v3 = __LONG_LONG_MAX__ }; - int test3[is_same<typeof(+v3), long>::value]; + enum enum3 { v3 = __LONG_MAX__ }; + int test3[is_same<__typeof(+v3), long>::value]; - enum enum4 { v4 = __LONG_LONG_MAX__ * 2ULL }; - int test4[is_same<typeof(+v4), unsigned long>::value]; -#else - enum enum3 { v3 = __LONG_LONG_MAX__ }; - int test3[is_same<typeof(+v3), long long>::value]; - - enum enum4 { v4 = __LONG_LONG_MAX__ * 2ULL }; - int test4[is_same<typeof(+v4), unsigned long long>::value]; -#endif + enum enum4 { v4 = __LONG_MAX__ * 2UL }; + int test4[is_same<__typeof(+v4), unsigned long>::value]; } diff --git a/test/SemaCXX/exception-spec.cpp b/test/SemaCXX/exception-spec.cpp index efc983322ae5d..291b359dfdc4a 100644 --- a/test/SemaCXX/exception-spec.cpp +++ b/test/SemaCXX/exception-spec.cpp @@ -1,4 +1,4 @@ -// RUN: clang-cc -fsyntax-only -verify -fms-extensions %s +// RUN: %clang_cc1 -fsyntax-only -verify -fms-extensions %s // Straight from the standard: // Plain function with spec @@ -160,11 +160,11 @@ void fnptrs() // return types and arguments must match exactly, no inheritance allowed void (*(*t7)())() throw(B1) = &s8; // valid - void (*(*t8)())() throw(A) = &s8; // expected-error {{return types differ}} expected-error {{incompatible type}} - void (*(*t9)())() throw(D) = &s8; // expected-error {{return types differ}} expected-error {{incompatible type}} + void (*(*t8)())() throw(A) = &s8; // expected-error {{return types differ}} + void (*(*t9)())() throw(D) = &s8; // expected-error {{return types differ}} void (*t10)(void (*)() throw(B1)) = &s9; // valid expected-warning{{disambiguated}} - void (*t11)(void (*)() throw(A)) = &s9; // expected-error {{argument types differ}} expected-error {{incompatible type}} expected-warning{{disambiguated}} - void (*t12)(void (*)() throw(D)) = &s9; // expected-error {{argument types differ}} expected-error {{incompatible type}} expected-warning{{disambiguated}} + void (*t11)(void (*)() throw(A)) = &s9; // expected-error {{argument types differ}} expected-warning{{disambiguated}} + void (*t12)(void (*)() throw(D)) = &s9; // expected-error {{argument types differ}} expected-warning{{disambiguated}} } // Member function stuff @@ -178,7 +178,7 @@ void mfnptr() { void (Str1::*pfn1)() throw(int) = &Str1::f; // valid void (Str1::*pfn2)() = &Str1::f; // valid - void (Str1::*pfn3)() throw() = &Str1::f; // expected-error {{not superset}} expected-error {{incompatible type}} + void (Str1::*pfn3)() throw() = &Str1::f; // expected-error {{not superset}} } // Don't suppress errors in template instantiation. diff --git a/test/SemaCXX/exceptions.cpp b/test/SemaCXX/exceptions.cpp index 5882b9cb70833..924b48aad26fc 100644 --- a/test/SemaCXX/exceptions.cpp +++ b/test/SemaCXX/exceptions.cpp @@ -1,4 +1,4 @@ -// RUN: clang-cc -fsyntax-only -verify %s +// RUN: %clang_cc1 -fsyntax-only -verify %s struct A; // expected-note 4 {{forward declaration of 'struct A'}} diff --git a/test/SemaCXX/expressions.cpp b/test/SemaCXX/expressions.cpp index 6a2f30d33e5eb..f3a05c1dbcedc 100644 --- a/test/SemaCXX/expressions.cpp +++ b/test/SemaCXX/expressions.cpp @@ -1,4 +1,4 @@ -// RUN: clang-cc -fsyntax-only -verify %s +// RUN: %clang_cc1 -fsyntax-only -verify %s void choice(int); int choice(bool); diff --git a/test/SemaCXX/fntype-decl.cpp b/test/SemaCXX/fntype-decl.cpp index ae85ff45353d7..b8ae625710dbb 100644 --- a/test/SemaCXX/fntype-decl.cpp +++ b/test/SemaCXX/fntype-decl.cpp @@ -1,4 +1,4 @@ -// RUN: clang-cc -fsyntax-only -verify %s +// RUN: %clang_cc1 -fsyntax-only -verify %s // PR2942 typedef void fn(int); diff --git a/test/SemaCXX/format-attribute.cpp b/test/SemaCXX/format-attribute.cpp index a21ebe1130663..92b7cf517effe 100644 --- a/test/SemaCXX/format-attribute.cpp +++ b/test/SemaCXX/format-attribute.cpp @@ -1,4 +1,4 @@ -// RUN: clang-cc -fsyntax-only -verify %s +// RUN: %clang_cc1 -fsyntax-only -verify %s // PR5521 struct A { void a(const char*,...) __attribute((format(printf,2,3))); }; diff --git a/test/SemaCXX/friend-class-nodecl.cpp b/test/SemaCXX/friend-class-nodecl.cpp index 13330f815db76..41e2da6a554d2 100644 --- a/test/SemaCXX/friend-class-nodecl.cpp +++ b/test/SemaCXX/friend-class-nodecl.cpp @@ -1,4 +1,4 @@ -// RUN: clang-cc -ast-print %s -o %t +// RUN: %clang_cc1 -ast-print %s -o %t // RUN: not grep '^ *class B' %t // Tests that the tag decls in friend declarations aren't added to the diff --git a/test/SemaCXX/friend.cpp b/test/SemaCXX/friend.cpp index d1c42eb9fbb53..ffad0e2b44ef4 100644 --- a/test/SemaCXX/friend.cpp +++ b/test/SemaCXX/friend.cpp @@ -1,4 +1,4 @@ -// RUN: clang-cc -fsyntax-only -verify %s +// RUN: %clang_cc1 -fsyntax-only -verify %s friend class A; // expected-error {{'friend' used outside of class}} void f() { friend class A; } // expected-error {{'friend' used outside of class}} @@ -15,3 +15,35 @@ namespace test0 { friend void ns::f(int a); }; } + +// Test derived from LLVM's Registry.h +namespace test1 { + template <class T> struct Outer { + void foo(T); + struct Inner { + friend void Outer::foo(T); + }; + }; + + void test() { + (void) Outer<int>::Inner(); + } +} + +// PR5476 +namespace test2 { + namespace foo { + void Func(int x); + } + + class Bar { + friend void ::test2::foo::Func(int x); + }; +} + +// PR5134 +namespace test3 { + class Foo { + friend const int getInt(int inInt = 0); + }; +} diff --git a/test/SemaCXX/function-overloaded-redecl.cpp b/test/SemaCXX/function-overloaded-redecl.cpp index 4d8e57c1b9fe5..00778816920e2 100644 --- a/test/SemaCXX/function-overloaded-redecl.cpp +++ b/test/SemaCXX/function-overloaded-redecl.cpp @@ -1,4 +1,4 @@ -// RUN: clang-cc -fsyntax-only -verify %s +// RUN: %clang_cc1 -fsyntax-only -verify %s typedef const int cInt; diff --git a/test/SemaCXX/function-redecl.cpp b/test/SemaCXX/function-redecl.cpp index 9f6783731d33e..b15d866165850 100644 --- a/test/SemaCXX/function-redecl.cpp +++ b/test/SemaCXX/function-redecl.cpp @@ -1,4 +1,4 @@ -// RUN: clang-cc -fsyntax-only -verify %s +// RUN: %clang_cc1 -fsyntax-only -verify %s int foo(int); namespace N { diff --git a/test/SemaCXX/function-type-qual.cpp b/test/SemaCXX/function-type-qual.cpp index f1d5aac7fc990..be61f2ba56395 100644 --- a/test/SemaCXX/function-type-qual.cpp +++ b/test/SemaCXX/function-type-qual.cpp @@ -1,4 +1,4 @@ -// RUN: clang-cc -fsyntax-only -verify %s +// RUN: %clang_cc1 -fsyntax-only -verify %s void f() const; // expected-error {{type qualifier is not allowed on this function}} diff --git a/test/SemaCXX/functional-cast.cpp b/test/SemaCXX/functional-cast.cpp index 142dba7b13f77..63be77008cb44 100644 --- a/test/SemaCXX/functional-cast.cpp +++ b/test/SemaCXX/functional-cast.cpp @@ -1,4 +1,4 @@ -// RUN: clang-cc -fsyntax-only -verify -faccess-control %s +// RUN: %clang_cc1 -fsyntax-only -verify -faccess-control %s // ------------ not interpreted as C-style cast ------------ diff --git a/test/SemaCXX/i-c-e-cxx.cpp b/test/SemaCXX/i-c-e-cxx.cpp index b7db907e2216d..8c70bc258701c 100644 --- a/test/SemaCXX/i-c-e-cxx.cpp +++ b/test/SemaCXX/i-c-e-cxx.cpp @@ -1,4 +1,4 @@ -// RUN: clang-cc -fsyntax-only -verify %s +// RUN: %clang_cc1 -fsyntax-only -verify %s // C++-specific tests for integral constant expressions. diff --git a/test/SemaCXX/illegal-member-initialization.cpp b/test/SemaCXX/illegal-member-initialization.cpp index 2d7c73d68a3f8..1890dbc9b594d 100644 --- a/test/SemaCXX/illegal-member-initialization.cpp +++ b/test/SemaCXX/illegal-member-initialization.cpp @@ -1,4 +1,4 @@ -// RUN: clang-cc -fsyntax-only -verify %s +// RUN: %clang_cc1 -fsyntax-only -verify %s struct A { A() : value(), cvalue() { } // expected-error {{cannot initialize the member to null in default constructor because reference member 'value' cannot be null-initialized}} \ @@ -20,3 +20,13 @@ struct X { B& b; // expected-note{{declared at}} const B cb; // expected-note{{declared at}} }; + + +// PR5924 +struct bar {}; +bar xxx(); + +struct foo { + foo_t a; // expected-error {{unknown type name 'foo_t'}} + foo() : a(xxx()) {} // no error here. +}; diff --git a/test/SemaCXX/implicit-int.cpp b/test/SemaCXX/implicit-int.cpp index 6fa8dd3463d30..9711adf34304e 100644 --- a/test/SemaCXX/implicit-int.cpp +++ b/test/SemaCXX/implicit-int.cpp @@ -1,4 +1,4 @@ -// RUN: clang-cc -fsyntax-only -verify %s +// RUN: %clang_cc1 -fsyntax-only -verify %s x; // expected-error{{C++ requires a type specifier for all declarations}} diff --git a/test/SemaCXX/implicit-member-functions.cpp b/test/SemaCXX/implicit-member-functions.cpp index 186780833d39d..40a61e47fd3c3 100644 --- a/test/SemaCXX/implicit-member-functions.cpp +++ b/test/SemaCXX/implicit-member-functions.cpp @@ -1,4 +1,4 @@ -// RUN: clang-cc -fsyntax-only -verify %s +// RUN: %clang_cc1 -fsyntax-only -verify %s struct A { }; // expected-note {{previous implicit declaration is here}} A::A() { } // expected-error {{definition of implicitly declared constructor}} diff --git a/test/SemaCXX/implicit-virtual-member-functions.cpp b/test/SemaCXX/implicit-virtual-member-functions.cpp index 30fe2786ba461..a6b1f8c537d2b 100644 --- a/test/SemaCXX/implicit-virtual-member-functions.cpp +++ b/test/SemaCXX/implicit-virtual-member-functions.cpp @@ -1,4 +1,4 @@ -// RUN: clang-cc -fsyntax-only -verify %s +// RUN: %clang_cc1 -fsyntax-only -verify %s struct A { virtual ~A(); }; diff --git a/test/SemaCXX/incomplete-call.cpp b/test/SemaCXX/incomplete-call.cpp index 3ce898a76f2cc..5bdaf829e64ee 100644 --- a/test/SemaCXX/incomplete-call.cpp +++ b/test/SemaCXX/incomplete-call.cpp @@ -1,4 +1,4 @@ -// RUN: clang-cc -fsyntax-only -verify %s +// RUN: %clang_cc1 -fsyntax-only -verify %s struct A; // expected-note 14 {{forward declaration of 'struct A'}} A f(); // expected-note {{note: 'f' declared here}} diff --git a/test/SemaCXX/inherit.cpp b/test/SemaCXX/inherit.cpp index 069e30d0cdfaa..aabed2bff9e7f 100644 --- a/test/SemaCXX/inherit.cpp +++ b/test/SemaCXX/inherit.cpp @@ -1,4 +1,4 @@ -// RUN: clang-cc -fsyntax-only -verify %s +// RUN: %clang_cc1 -fsyntax-only -verify %s class A { }; class B1 : A { }; diff --git a/test/SemaCXX/inline.cpp b/test/SemaCXX/inline.cpp index 7d0505a435eef..e569300faf771 100644 --- a/test/SemaCXX/inline.cpp +++ b/test/SemaCXX/inline.cpp @@ -1,4 +1,4 @@ -// RUN: clang-cc -fsyntax-only -verify %s +// RUN: %clang_cc1 -fsyntax-only -verify %s // Check that we don't allow illegal uses of inline // (checking C++-only constructs here) diff --git a/test/SemaCXX/invalid-member-expr.cpp b/test/SemaCXX/invalid-member-expr.cpp index 730beb32698be..666595c84f071 100644 --- a/test/SemaCXX/invalid-member-expr.cpp +++ b/test/SemaCXX/invalid-member-expr.cpp @@ -1,4 +1,4 @@ -// RUN: clang-cc -fsyntax-only -verify %s +// RUN: %clang_cc1 -fsyntax-only -verify %s class X {}; diff --git a/test/SemaCXX/invalid-template-specifier.cpp b/test/SemaCXX/invalid-template-specifier.cpp index 034ad73b086ad..bcd6da7f32f77 100644 --- a/test/SemaCXX/invalid-template-specifier.cpp +++ b/test/SemaCXX/invalid-template-specifier.cpp @@ -1,4 +1,4 @@ -// RUN: clang-cc %s -verify -fsyntax-only +// RUN: %clang_cc1 %s -verify -fsyntax-only // PR4809 // This test is primarily checking that this doesn't crash, not the particular // diagnostics. diff --git a/test/SemaCXX/libstdcxx_is_pod_hack.cpp b/test/SemaCXX/libstdcxx_is_pod_hack.cpp index df064bc6a0faf..7a4bebca864e5 100644 --- a/test/SemaCXX/libstdcxx_is_pod_hack.cpp +++ b/test/SemaCXX/libstdcxx_is_pod_hack.cpp @@ -1,4 +1,4 @@ -// RUN: clang-cc -fsyntax-only %s +// RUN: %clang_cc1 -fsyntax-only %s template<typename T> struct __is_pod { diff --git a/test/SemaCXX/linkage-spec.cpp b/test/SemaCXX/linkage-spec.cpp index d19727ac0766c..57730a62aae33 100644 --- a/test/SemaCXX/linkage-spec.cpp +++ b/test/SemaCXX/linkage-spec.cpp @@ -1,4 +1,4 @@ -// RUN: clang-cc -fsyntax-only -verify %s +// RUN: %clang_cc1 -fsyntax-only -verify %s extern "C" { extern "C" void f(int); } diff --git a/test/SemaCXX/literal-type.cpp b/test/SemaCXX/literal-type.cpp index 0dca9c9a92b31..142dd756e5a3a 100644 --- a/test/SemaCXX/literal-type.cpp +++ b/test/SemaCXX/literal-type.cpp @@ -1,4 +1,4 @@ -// RUN: clang-cc -fsyntax-only -verify -std=c++0x %s +// RUN: %clang_cc1 -fsyntax-only -verify -std=c++0x %s static_assert(__is_literal(int), "fail"); static_assert(__is_literal(void*), "fail"); diff --git a/test/SemaCXX/member-expr-anonymous-union.cpp b/test/SemaCXX/member-expr-anonymous-union.cpp index 9566df4a20ff9..0f0359667b389 100644 --- a/test/SemaCXX/member-expr-anonymous-union.cpp +++ b/test/SemaCXX/member-expr-anonymous-union.cpp @@ -1,4 +1,4 @@ -// RUN: clang-cc %s -fsyntax-only -verify +// RUN: %clang_cc1 %s -fsyntax-only -verify // PR5543 struct A { int x; union { int* y; float& z; }; }; struct B : A {int a;}; diff --git a/test/SemaCXX/member-expr-static.cpp b/test/SemaCXX/member-expr-static.cpp index 2fa7e0781c1e0..7ed60f7a17b78 100644 --- a/test/SemaCXX/member-expr-static.cpp +++ b/test/SemaCXX/member-expr-static.cpp @@ -1,4 +1,4 @@ -// RUN: clang-cc -fsyntax-only -verify %s +// RUN: %clang_cc1 -fsyntax-only -verify %s typedef void (*thread_continue_t)(); extern "C" { diff --git a/test/SemaCXX/member-expr.cpp b/test/SemaCXX/member-expr.cpp index 9cd6855ccd553..13ff64d8cffc6 100644 --- a/test/SemaCXX/member-expr.cpp +++ b/test/SemaCXX/member-expr.cpp @@ -1,4 +1,4 @@ -// RUN: clang-cc -fsyntax-only -verify %s +// RUN: %clang_cc1 -fsyntax-only -verify %s class X{ public: diff --git a/test/SemaCXX/member-location.cpp b/test/SemaCXX/member-location.cpp index cb53ae15123dd..c3099d25e0e1b 100644 --- a/test/SemaCXX/member-location.cpp +++ b/test/SemaCXX/member-location.cpp @@ -1,5 +1,5 @@ -// RUN: clang-cc -fsyntax-only -verify %s +// RUN: %clang_cc1 -fsyntax-only -verify %s // PR4103: Make sure we have a location for the error class A { float a(int *); int b(); }; -int A::b() { return a(a((int*)0)); } // expected-error {{incompatible type}} +int A::b() { return a(a((int*)0)); } // expected-error {{cannot initialize a parameter of type 'int *' with an rvalue of type 'float'}} diff --git a/test/SemaCXX/member-name-lookup.cpp b/test/SemaCXX/member-name-lookup.cpp index e95641b4bf9c7..ff14416089d54 100644 --- a/test/SemaCXX/member-name-lookup.cpp +++ b/test/SemaCXX/member-name-lookup.cpp @@ -1,4 +1,4 @@ -// RUN: clang-cc -fsyntax-only -verify %s +// RUN: %clang_cc1 -fsyntax-only -verify %s struct A { int a; // expected-note 4{{member found by ambiguous name lookup}} static int b; diff --git a/test/SemaCXX/member-operator-expr.cpp b/test/SemaCXX/member-operator-expr.cpp index 4d0e00fd60107..5e3d0c0a1bc85 100644 --- a/test/SemaCXX/member-operator-expr.cpp +++ b/test/SemaCXX/member-operator-expr.cpp @@ -1,4 +1,4 @@ -// RUN: clang-cc -fsyntax-only -verify %s +// RUN: %clang_cc1 -fsyntax-only -verify %s class X { public: diff --git a/test/SemaCXX/member-pointer-size.cpp b/test/SemaCXX/member-pointer-size.cpp index 952027d123951..3aa1eaf5f256a 100644 --- a/test/SemaCXX/member-pointer-size.cpp +++ b/test/SemaCXX/member-pointer-size.cpp @@ -1,5 +1,5 @@ -// RUN: clang-cc -triple x86_64-unknown-unknown %s -fsyntax-only -verify -// RUN: clang-cc -triple i686-unknown-unknown %s -fsyntax-only -verify +// RUN: %clang_cc1 -triple x86_64-unknown-unknown %s -fsyntax-only -verify +// RUN: %clang_cc1 -triple i686-unknown-unknown %s -fsyntax-only -verify #include <stddef.h> struct A; diff --git a/test/SemaCXX/member-pointer.cpp b/test/SemaCXX/member-pointer.cpp index d13b16e6d6727..65d05eb5af749 100644 --- a/test/SemaCXX/member-pointer.cpp +++ b/test/SemaCXX/member-pointer.cpp @@ -1,4 +1,4 @@ -// RUN: clang-cc -fsyntax-only -verify %s +// RUN: %clang_cc1 -fsyntax-only -verify %s struct A {}; enum B { Dummy }; @@ -35,8 +35,8 @@ void f() { pdid = pdi2; // Fail conversion due to ambiguity and virtuality. - int F::*pdif = pdi1; // expected-error {{ambiguous conversion from pointer to member of base class 'struct A' to pointer to member of derived class 'struct F'}} expected-error {{incompatible type}} - int G::*pdig = pdi1; // expected-error {{conversion from pointer to member of class 'struct A' to pointer to member of class 'struct G' via virtual base 'struct D' is not allowed}} expected-error {{incompatible type}} + int F::*pdif = pdi1; // expected-error {{ambiguous conversion from pointer to member of base class 'struct A' to pointer to member of derived class 'struct F'}} + int G::*pdig = pdi1; // expected-error {{conversion from pointer to member of class 'struct A' to pointer to member of class 'struct G' via virtual base 'struct D' is not allowed}} // Conversion to member of base. pdi1 = pdid; // expected-error {{incompatible type assigning 'int struct D::*', expected 'int struct A::*'}} diff --git a/test/SemaCXX/member-pointers-2.cpp b/test/SemaCXX/member-pointers-2.cpp index fea1d74b02555..4b3b82c029753 100644 --- a/test/SemaCXX/member-pointers-2.cpp +++ b/test/SemaCXX/member-pointers-2.cpp @@ -1,4 +1,4 @@ -// RUN: clang-cc -emit-llvm-only %s +// RUN: %clang_cc1 -emit-llvm-only %s // Tests that Sema properly creates member-access expressions for // these instead of bare FieldDecls. diff --git a/test/SemaCXX/missing-members.cpp b/test/SemaCXX/missing-members.cpp index 28ad9a04e7906..9ec17f7b99335 100644 --- a/test/SemaCXX/missing-members.cpp +++ b/test/SemaCXX/missing-members.cpp @@ -1,4 +1,4 @@ -// RUN: clang-cc -fsyntax-only -verify %s +// RUN: %clang_cc1 -fsyntax-only -verify %s namespace A { namespace B { class C { }; diff --git a/test/SemaCXX/ms-exception-spec.cpp b/test/SemaCXX/ms-exception-spec.cpp index b84ea178e1e22..bda56f5468d4a 100644 --- a/test/SemaCXX/ms-exception-spec.cpp +++ b/test/SemaCXX/ms-exception-spec.cpp @@ -1,3 +1,3 @@ -// RUN: clang-cc %s -fsyntax-only -verify -fms-extensions +// RUN: %clang_cc1 %s -fsyntax-only -verify -fms-extensions void f() throw(...) { } diff --git a/test/SemaCXX/namespace-alias.cpp b/test/SemaCXX/namespace-alias.cpp index d5e423848cb52..f9836064d131b 100644 --- a/test/SemaCXX/namespace-alias.cpp +++ b/test/SemaCXX/namespace-alias.cpp @@ -1,4 +1,4 @@ -// RUN: clang-cc -fsyntax-only -verify %s +// RUN: %clang_cc1 -fsyntax-only -verify %s namespace N { }; diff --git a/test/SemaCXX/namespace.cpp b/test/SemaCXX/namespace.cpp index 5ed6ba50ce1bd..ab690b7286ec8 100644 --- a/test/SemaCXX/namespace.cpp +++ b/test/SemaCXX/namespace.cpp @@ -1,4 +1,4 @@ -// RUN: clang-cc -fsyntax-only -verify %s +// RUN: %clang_cc1 -fsyntax-only -verify %s namespace A { // expected-note 2 {{previous definition is here}} int A; void f() { A = 0; } diff --git a/test/SemaCXX/nested-name-spec.cpp b/test/SemaCXX/nested-name-spec.cpp index 6a51261e26fcf..4e65b41e666c2 100644 --- a/test/SemaCXX/nested-name-spec.cpp +++ b/test/SemaCXX/nested-name-spec.cpp @@ -1,4 +1,4 @@ -// RUN: clang-cc -fsyntax-only -std=c++98 -verify %s +// RUN: %clang_cc1 -fsyntax-only -std=c++98 -verify %s namespace A { struct C { static int cx; @@ -178,7 +178,7 @@ bool (foo_S::value); namespace somens { - struct a { }; + struct a { }; // expected-note{{candidate function}} } template <typename T> @@ -189,8 +189,34 @@ class foo { // PR4452 / PR4451 foo<somens:a> a2; // expected-error {{unexpected ':' in nested name specifier}} -somens::a a3 = a2; // expected-error {{cannot initialize 'a3' with an lvalue of type 'foo<somens::a>'}} +somens::a a3 = a2; // expected-error {{no viable conversion}} +// typedefs and using declarations. +namespace test1 { + namespace ns { + class Counter { static int count; }; + typedef Counter counter; + } + using ns::counter; + class Test { + void test1() { + counter c; + c.count++; + counter::count++; + } + }; +} +// We still need to do lookup in the lexical scope, even if we push a +// non-lexical scope. +namespace test2 { + namespace ns { + int *count_ptr; + } + namespace { + int count = 0; + } + int *ns::count_ptr = &count; +} diff --git a/test/SemaCXX/new-delete.cpp b/test/SemaCXX/new-delete.cpp index 8a3ec8b16a262..0e0f630bc497f 100644 --- a/test/SemaCXX/new-delete.cpp +++ b/test/SemaCXX/new-delete.cpp @@ -1,4 +1,4 @@ -// RUN: clang-cc -fsyntax-only -verify %s +// RUN: %clang_cc1 -fsyntax-only -verify %s #include <stddef.h> @@ -18,7 +18,8 @@ struct V : U { }; -void* operator new(size_t); // expected-note 2 {{candidate}} +// PR5823 +void* operator new(const size_t); // expected-note 2 {{candidate}} void* operator new(size_t, int*); // expected-note 3 {{candidate}} void* operator new(size_t, float*); // expected-note 3 {{candidate}} void* operator new(size_t, S); // expected-note 2 {{candidate}} @@ -59,12 +60,12 @@ void bad_news(int *ip) (void)new int[1][i]; // expected-error {{only the first dimension}} (void)new (int[1][i]); // expected-error {{only the first dimension}} (void)new (int[i]); // expected-error {{when type is in parentheses}} - (void)new int(*(S*)0); // expected-error {{incompatible type initializing}} - (void)new int(1, 2); // expected-error {{initializer of a builtin type can only take one argument}} + (void)new int(*(S*)0); // expected-error {{no viable conversion from 'struct S' to 'int'}} + (void)new int(1, 2); // expected-error {{excess elements in scalar initializer}} (void)new S(1); // expected-error {{no matching constructor}} - (void)new S(1, 1); // expected-error {{call to constructor of 'S' is ambiguous}} - (void)new const int; // expected-error {{must provide an initializer}} - (void)new float*(ip); // expected-error {{incompatible type initializing 'int *', expected 'float *'}} + (void)new S(1, 1); // expected-error {{call to constructor of 'struct S' is ambiguous}} + (void)new const int; // expected-error {{default initialization of an object of const type 'int const'}} + (void)new float*(ip); // expected-error {{cannot initialize a value of type 'float *' with an lvalue of type 'int *'}} // Undefined, but clang should reject it directly. (void)new int[-1]; // expected-error {{array size is negative}} (void)new int[*(S*)0]; // expected-error {{array size expression must have integral or enumerated type, not 'struct S'}} @@ -215,4 +216,3 @@ static void* f(void* g) { return new (g) X13(); } - diff --git a/test/SemaCXX/no-implicit-builtin-decls.cpp b/test/SemaCXX/no-implicit-builtin-decls.cpp index bd11f92f7e629..d82f7f18bffe0 100644 --- a/test/SemaCXX/no-implicit-builtin-decls.cpp +++ b/test/SemaCXX/no-implicit-builtin-decls.cpp @@ -1,7 +1,7 @@ -// RUN: clang-cc -fsyntax-only -verify %s +// RUN: %clang_cc1 -fsyntax-only -verify %s void f() { - void *p = malloc(sizeof(int) * 10); // expected-error{{no matching function for call to 'malloc'}} + void *p = malloc(sizeof(int) * 10); // expected-error{{use of undeclared identifier 'malloc'}} } int malloc(double); diff --git a/test/SemaCXX/nullptr.cpp b/test/SemaCXX/nullptr.cpp index 6cc5a8168313a..a3aab7fbe3e09 100644 --- a/test/SemaCXX/nullptr.cpp +++ b/test/SemaCXX/nullptr.cpp @@ -1,4 +1,4 @@ -// RUN: clang-cc -fsyntax-only -verify -std=c++0x %s +// RUN: %clang_cc1 -fsyntax-only -verify -std=c++0x %s #include <stdint.h> // Don't have decltype yet. @@ -29,7 +29,7 @@ nullptr_t f(nullptr_t null) bool b = nullptr; // Can't convert nullptr to integral implicitly. - uintptr_t i = nullptr; // expected-error {{incompatible type initializing}} + uintptr_t i = nullptr; // expected-error {{cannot initialize}} // Operators (void)(null == nullptr); diff --git a/test/SemaCXX/offsetof.cpp b/test/SemaCXX/offsetof.cpp index bc7a707ee546b..f3dc52df49771 100644 --- a/test/SemaCXX/offsetof.cpp +++ b/test/SemaCXX/offsetof.cpp @@ -1,4 +1,4 @@ -// RUN: clang-cc -fsyntax-only -verify %s -Winvalid-offsetof +// RUN: %clang_cc1 -fsyntax-only -verify %s -Winvalid-offsetof struct NonPOD { virtual void f(); diff --git a/test/SemaCXX/overload-call-copycon.cpp b/test/SemaCXX/overload-call-copycon.cpp index 6436236b81e98..472fae26b81ff 100644 --- a/test/SemaCXX/overload-call-copycon.cpp +++ b/test/SemaCXX/overload-call-copycon.cpp @@ -1,4 +1,4 @@ -// RUN: clang-cc -fsyntax-only %s -Wnon-pod-varargs +// RUN: %clang_cc1 -fsyntax-only %s -Wnon-pod-varargs class X { }; int& copycon(X x); diff --git a/test/SemaCXX/overload-call.cpp b/test/SemaCXX/overload-call.cpp index 5d2718208f2bc..299c0a78f9267 100644 --- a/test/SemaCXX/overload-call.cpp +++ b/test/SemaCXX/overload-call.cpp @@ -1,4 +1,4 @@ -// RUN: clang-cc -fsyntax-only -pedantic -verify %s +// RUN: %clang_cc1 -fsyntax-only -pedantic -verify %s int* f(int) { return 0; } float* f(float) { return 0; } void f(); diff --git a/test/SemaCXX/overload-decl.cpp b/test/SemaCXX/overload-decl.cpp index 2bc832f558f78..c610ff7ab0645 100644 --- a/test/SemaCXX/overload-decl.cpp +++ b/test/SemaCXX/overload-decl.cpp @@ -1,4 +1,4 @@ -// RUN: clang-cc -fsyntax-only -verify %s +// RUN: %clang_cc1 -fsyntax-only -verify %s void f(); void f(int); void f(int, float); diff --git a/test/SemaCXX/overload-member-call.cpp b/test/SemaCXX/overload-member-call.cpp index 937b65d633f9d..4bb3ff3a54cd6 100644 --- a/test/SemaCXX/overload-member-call.cpp +++ b/test/SemaCXX/overload-member-call.cpp @@ -1,4 +1,4 @@ -// RUN: clang-cc -fsyntax-only -verify %s +// RUN: %clang_cc1 -fsyntax-only -verify %s struct X { int& f(int) const; // expected-note 2 {{candidate function}} diff --git a/test/SemaCXX/overload-value-dep-arg.cpp b/test/SemaCXX/overload-value-dep-arg.cpp index 1e94d5a301365..c1834a7225773 100644 --- a/test/SemaCXX/overload-value-dep-arg.cpp +++ b/test/SemaCXX/overload-value-dep-arg.cpp @@ -1,4 +1,4 @@ -// RUN: clang-cc -fsyntax-only -verify %s +// RUN: %clang_cc1 -fsyntax-only -verify %s class C { C(void*); diff --git a/test/SemaCXX/overloaded-builtin-operators.cpp b/test/SemaCXX/overloaded-builtin-operators.cpp index fd0cbc6c86436..12903cc7facf4 100644 --- a/test/SemaCXX/overloaded-builtin-operators.cpp +++ b/test/SemaCXX/overloaded-builtin-operators.cpp @@ -1,4 +1,4 @@ -// RUN: clang-cc -fsyntax-only -verify %s +// RUN: %clang_cc1 -fsyntax-only -verify %s struct yes; struct no; diff --git a/test/SemaCXX/overloaded-operator-decl.cpp b/test/SemaCXX/overloaded-operator-decl.cpp index fc17faf6634f4..c43d7c217cca5 100644 --- a/test/SemaCXX/overloaded-operator-decl.cpp +++ b/test/SemaCXX/overloaded-operator-decl.cpp @@ -1,4 +1,4 @@ -// RUN: clang-cc -fsyntax-only -verify %s +// RUN: %clang_cc1 -fsyntax-only -verify %s struct X { X(); X(int); diff --git a/test/SemaCXX/overloaded-operator.cpp b/test/SemaCXX/overloaded-operator.cpp index 672b8b4fc2669..a20c69b8d5d1d 100644 --- a/test/SemaCXX/overloaded-operator.cpp +++ b/test/SemaCXX/overloaded-operator.cpp @@ -1,4 +1,4 @@ -// RUN: clang-cc -fsyntax-only -verify %s +// RUN: %clang_cc1 -fsyntax-only -verify %s class X { }; X operator+(X, X); diff --git a/test/SemaCXX/prefetch-enum.cpp b/test/SemaCXX/prefetch-enum.cpp index 829321fb0e91d..3c77dae70ff5d 100644 --- a/test/SemaCXX/prefetch-enum.cpp +++ b/test/SemaCXX/prefetch-enum.cpp @@ -1,4 +1,4 @@ -// RUN: clang-cc -fsyntax-only %s -verify +// RUN: %clang_cc1 -fsyntax-only %s -verify // PR5679 enum X { A = 3 }; diff --git a/test/SemaCXX/primary-base.cpp b/test/SemaCXX/primary-base.cpp index a7e18bd528a16..a6cbbad2427a2 100644 --- a/test/SemaCXX/primary-base.cpp +++ b/test/SemaCXX/primary-base.cpp @@ -1,4 +1,4 @@ -// RUN: clang-cc -fsyntax-only -verify %s +// RUN: %clang_cc1 -fsyntax-only -verify %s class A { virtual void f(); }; class B : virtual A { }; diff --git a/test/SemaCXX/pseudo-destructors.cpp b/test/SemaCXX/pseudo-destructors.cpp index 8f69def9fd4f1..15e37c5882020 100644 --- a/test/SemaCXX/pseudo-destructors.cpp +++ b/test/SemaCXX/pseudo-destructors.cpp @@ -1,4 +1,4 @@ -// RUN: clang-cc -fsyntax-only -verify %s +// RUN: %clang_cc1 -fsyntax-only -verify %s struct A {}; enum Foo { F }; diff --git a/test/SemaCXX/ptrtomember-badcall.cpp b/test/SemaCXX/ptrtomember-badcall.cpp index 42b8e3b6e0c93..fb774d85e3e48 100644 --- a/test/SemaCXX/ptrtomember-badcall.cpp +++ b/test/SemaCXX/ptrtomember-badcall.cpp @@ -1,4 +1,4 @@ -// RUN: clang-cc -fsyntax-only -verify %s -std=c++0x +// RUN: %clang_cc1 -fsyntax-only -verify %s -std=c++0x struct S { int i; diff --git a/test/SemaCXX/ptrtomember-overload-resolution.cpp b/test/SemaCXX/ptrtomember-overload-resolution.cpp index b3b65ce840cbf..4c7908e1137e4 100644 --- a/test/SemaCXX/ptrtomember-overload-resolution.cpp +++ b/test/SemaCXX/ptrtomember-overload-resolution.cpp @@ -1,4 +1,4 @@ -// RUN: clang-cc -fsyntax-only -verify %s -std=c++0x +// RUN: %clang_cc1 -fsyntax-only -verify %s -std=c++0x // 13.3.3.2 Ranking implicit conversion sequences // conversion of A::* to B::* is better than conversion of A::* to C::*, diff --git a/test/SemaCXX/qual-id-test.cpp b/test/SemaCXX/qual-id-test.cpp index 02e69996c7726..00dc662d06709 100644 --- a/test/SemaCXX/qual-id-test.cpp +++ b/test/SemaCXX/qual-id-test.cpp @@ -1,4 +1,4 @@ -// RUN: clang-cc -fsyntax-only -verify %s +// RUN: %clang_cc1 -fsyntax-only -verify %s namespace A { namespace B @@ -137,4 +137,4 @@ struct a { a a; -int a::sa = a.a; +int a::sa = a.a; // expected-error {{invalid use of nonstatic data member 'a'}} diff --git a/test/SemaCXX/qualification-conversion.cpp b/test/SemaCXX/qualification-conversion.cpp index 01e503ddac6c8..f1af5bf2852d1 100644 --- a/test/SemaCXX/qualification-conversion.cpp +++ b/test/SemaCXX/qualification-conversion.cpp @@ -1,4 +1,4 @@ -// RUN: clang-cc -fsyntax-only -pedantic -verify %s +// RUN: %clang_cc1 -fsyntax-only -pedantic -verify %s int* quals1(int const * p); int* quals2(int const * const * pp); int* quals3(int const * * const * ppp); // expected-note{{candidate function}} @@ -21,3 +21,14 @@ void test_mquals(int A::*p, int A::* A::*pp, int A::* A::* A::*ppp) { mquals2(pp); mquals3(ppp); // expected-error {{no matching}} } + +void aquals1(int const (*p)[1]); +void aquals2(int * const (*pp)[1]); +void aquals2a(int const * (*pp2)[1]); // expected-note{{candidate function}} + +void test_aquals(int (*p)[1], int * (*pp)[1], int * (*pp2)[1]) { + int const (*p2)[1] = p; + aquals1(p); + aquals2(pp); + aquals2a(pp2); // expected-error {{no matching}} +} diff --git a/test/SemaCXX/qualified-id-lookup.cpp b/test/SemaCXX/qualified-id-lookup.cpp index 5a11a0cd07b83..a187d4908cd4d 100644 --- a/test/SemaCXX/qualified-id-lookup.cpp +++ b/test/SemaCXX/qualified-id-lookup.cpp @@ -1,4 +1,4 @@ -// RUN: clang-cc -fsyntax-only -verify %s +// RUN: %clang_cc1 -fsyntax-only -verify %s namespace Ns { int f(); // expected-note{{previous declaration is here}} diff --git a/test/SemaCXX/qualified-names-diag.cpp b/test/SemaCXX/qualified-names-diag.cpp index 3bffd7c05d3bc..86c10888b8a22 100644 --- a/test/SemaCXX/qualified-names-diag.cpp +++ b/test/SemaCXX/qualified-names-diag.cpp @@ -1,4 +1,4 @@ -// RUN: clang-cc -fsyntax-only -verify %s +// RUN: %clang_cc1 -fsyntax-only -verify %s namespace foo { namespace wibble { struct x { int y; }; diff --git a/test/SemaCXX/qualified-names-print.cpp b/test/SemaCXX/qualified-names-print.cpp index 1cb19f0312e4b..2099268a1a927 100644 --- a/test/SemaCXX/qualified-names-print.cpp +++ b/test/SemaCXX/qualified-names-print.cpp @@ -1,4 +1,4 @@ -// RUN: clang-cc -ast-print %s 2>&1 | grep "N::M::X<INT>::value" +// RUN: %clang_cc1 -ast-print %s 2>&1 | grep "N::M::X<INT>::value" namespace N { namespace M { template<typename T> diff --git a/test/SemaCXX/ref-init-ambiguous.cpp b/test/SemaCXX/ref-init-ambiguous.cpp index 60620993b43c1..976879ecd0ae2 100644 --- a/test/SemaCXX/ref-init-ambiguous.cpp +++ b/test/SemaCXX/ref-init-ambiguous.cpp @@ -1,21 +1,20 @@ -// RUN: clang-cc -fsyntax-only -verify %s -std=c++0x +// RUN: %clang_cc1 -fsyntax-only -verify %s -std=c++0x enum E2 { }; struct A { - operator E2&(); // expected-note 2 {{candidate function}} + operator E2&(); // expected-note 3 {{candidate function}} }; struct B { - operator E2&(); // expected-note 2 {{candidate function}} + operator E2&(); // expected-note 3 {{candidate function}} }; struct C : B, A { }; void test(C c) { - // FIXME: state that there was an ambiguity in the conversion! - const E2 &e2 = c; // expected-error {{reference to type 'enum E2 const' could not bind to an lvalue of type 'struct C'}} + const E2 &e2 = c; // expected-error {{reference initialization of type 'enum E2 const &' with initializer of type 'struct C' is ambiguous}} } void foo(const E2 &); diff --git a/test/SemaCXX/references.cpp b/test/SemaCXX/references.cpp index 45d3923ff0ad5..630f53f2839ec 100644 --- a/test/SemaCXX/references.cpp +++ b/test/SemaCXX/references.cpp @@ -1,4 +1,4 @@ -// RUN: clang-cc -fsyntax-only -verify %s +// RUN: %clang_cc1 -fsyntax-only -verify %s int g(int); void f() { diff --git a/test/SemaCXX/reinterpret-cast.cpp b/test/SemaCXX/reinterpret-cast.cpp index bfe8887bd3d32..da675609d1238 100644 --- a/test/SemaCXX/reinterpret-cast.cpp +++ b/test/SemaCXX/reinterpret-cast.cpp @@ -1,4 +1,4 @@ -// RUN: clang-cc -fsyntax-only -verify %s +// RUN: %clang_cc1 -fsyntax-only -verify %s #include <stdint.h> diff --git a/test/SemaCXX/reinterpret-fn-obj-pedantic.cpp b/test/SemaCXX/reinterpret-fn-obj-pedantic.cpp index 16b8659711e2a..09d08f95ee280 100644 --- a/test/SemaCXX/reinterpret-fn-obj-pedantic.cpp +++ b/test/SemaCXX/reinterpret-fn-obj-pedantic.cpp @@ -1,4 +1,4 @@ -// RUN: clang-cc -fsyntax-only -verify -std=c++98 -pedantic %s +// RUN: %clang_cc1 -fsyntax-only -verify -std=c++98 -pedantic %s void fnptrs() { diff --git a/test/SemaCXX/return-stack-addr.cpp b/test/SemaCXX/return-stack-addr.cpp index 457de297b0082..ba64765603607 100644 --- a/test/SemaCXX/return-stack-addr.cpp +++ b/test/SemaCXX/return-stack-addr.cpp @@ -1,4 +1,4 @@ -// RUN: clang-cc -fsyntax-only -verify %s +// RUN: %clang_cc1 -fsyntax-only -verify %s int* ret_local() { int x = 1; diff --git a/test/SemaCXX/return.cpp b/test/SemaCXX/return.cpp index 03b0ddb879658..e682fdfb50092 100644 --- a/test/SemaCXX/return.cpp +++ b/test/SemaCXX/return.cpp @@ -1,4 +1,4 @@ -// RUN: clang-cc %s -fsyntax-only -verify +// RUN: %clang_cc1 %s -fsyntax-only -verify int test1() { throw; diff --git a/test/SemaCXX/rval-references-xfail.cpp b/test/SemaCXX/rval-references-xfail.cpp new file mode 100644 index 0000000000000..d41f8f141cde1 --- /dev/null +++ b/test/SemaCXX/rval-references-xfail.cpp @@ -0,0 +1,14 @@ +// RUN: %clang_cc1 -fsyntax-only -verify -std=c++0x %s +// XFAIL: * +struct MoveOnly { + MoveOnly(); + MoveOnly(const MoveOnly&) = delete; // expected-note {{candidate function}} \ + // expected-note 3{{explicitly marked deleted here}} + MoveOnly(MoveOnly&&); // expected-note {{candidate function}} + MoveOnly(int&&); // expected-note {{candidate function}} +}; + +MoveOnly returning() { + MoveOnly mo; + return mo; +} diff --git a/test/SemaCXX/rval-references.cpp b/test/SemaCXX/rval-references.cpp index 7a71607707c88..7ff3d584c02e6 100644 --- a/test/SemaCXX/rval-references.cpp +++ b/test/SemaCXX/rval-references.cpp @@ -1,4 +1,4 @@ -// RUN: clang-cc -fsyntax-only -verify -std=c++0x %s +// RUN: %clang_cc1 -fsyntax-only -verify -std=c++0x %s typedef int&& irr; typedef irr& ilr_c1; // Collapses to int& @@ -65,27 +65,23 @@ int&& should_not_warn(int&& i) { // But GCC 4.4 does // Test the return dance. This also tests IsReturnCopyElidable. struct MoveOnly { MoveOnly(); - MoveOnly(const MoveOnly&) = delete; // expected-note {{candidate function}} + MoveOnly(const MoveOnly&) = delete; // expected-note {{candidate function}} \ + // expected-note 3{{explicitly marked deleted here}} MoveOnly(MoveOnly&&); // expected-note {{candidate function}} MoveOnly(int&&); // expected-note {{candidate function}} }; -MoveOnly returning() { - MoveOnly mo; - return mo; -} - MoveOnly gmo; MoveOnly returningNonEligible() { int i; static MoveOnly mo; MoveOnly &r = mo; if (0) // Copy from global can't be elided - return gmo; // expected-error {{incompatible type returning}} + return gmo; // expected-error {{call to deleted constructor}} else if (0) // Copy from local static can't be elided - return mo; // expected-error {{incompatible type returning}} + return mo; // expected-error {{call to deleted constructor}} else if (0) // Copy from reference can't be elided - return r; // expected-error {{incompatible type returning}} + return r; // expected-error {{call to deleted constructor}} else // Construction from different type can't be elided return i; // expected-error {{no viable conversion from 'int' to 'struct MoveOnly'}} } diff --git a/test/SemaCXX/statements.cpp b/test/SemaCXX/statements.cpp index d6925fe032e91..36982582fa120 100644 --- a/test/SemaCXX/statements.cpp +++ b/test/SemaCXX/statements.cpp @@ -1,4 +1,4 @@ -// RUN: clang-cc %s -fsyntax-only -pedantic +// RUN: %clang_cc1 %s -fsyntax-only -pedantic void foo() { return foo(); diff --git a/test/SemaCXX/static-array-member.cpp b/test/SemaCXX/static-array-member.cpp index dac70cd2eabf7..8f575491b245e 100644 --- a/test/SemaCXX/static-array-member.cpp +++ b/test/SemaCXX/static-array-member.cpp @@ -1,4 +1,4 @@ -// RUN: clang-cc -fsyntax-only %s +// RUN: %clang_cc1 -fsyntax-only %s struct X0 { static int array[]; diff --git a/test/SemaCXX/static-assert.cpp b/test/SemaCXX/static-assert.cpp index caf76033af704..62208cd2aeebe 100644 --- a/test/SemaCXX/static-assert.cpp +++ b/test/SemaCXX/static-assert.cpp @@ -1,4 +1,4 @@ -// RUN: clang-cc -fsyntax-only -verify %s -std=c++0x +// RUN: %clang_cc1 -fsyntax-only -verify %s -std=c++0x int f(); diff --git a/test/SemaCXX/static-cast-complete-type.cpp b/test/SemaCXX/static-cast-complete-type.cpp index 83583a5adf8ee..11bf22dfe8999 100644 --- a/test/SemaCXX/static-cast-complete-type.cpp +++ b/test/SemaCXX/static-cast-complete-type.cpp @@ -1,4 +1,4 @@ -// RUN: clang-cc -fsyntax-only -verify %s +// RUN: %clang_cc1 -fsyntax-only -verify %s template<typename T> struct S { S(int); }; diff --git a/test/SemaCXX/static-cast.cpp b/test/SemaCXX/static-cast.cpp index d3962727b806f..cdaa843b81708 100644 --- a/test/SemaCXX/static-cast.cpp +++ b/test/SemaCXX/static-cast.cpp @@ -1,4 +1,4 @@ -// RUN: clang-cc -fsyntax-only -verify -faccess-control %s +// RUN: %clang_cc1 -fsyntax-only -verify -faccess-control %s struct A {}; struct B : public A {}; // Single public base. struct C1 : public virtual B {}; // Single virtual base. diff --git a/test/SemaCXX/static-initializers.cpp b/test/SemaCXX/static-initializers.cpp index a651243df7ef7..ca49fce052e36 100644 --- a/test/SemaCXX/static-initializers.cpp +++ b/test/SemaCXX/static-initializers.cpp @@ -1,4 +1,4 @@ -// RUN: clang-cc -fsyntax-only -verify %s +// RUN: %clang_cc1 -fsyntax-only -verify %s int f() { return 10; } diff --git a/test/SemaCXX/struct-class-redecl.cpp b/test/SemaCXX/struct-class-redecl.cpp index 4b6cef6dd2bfa..d3d6d79ea82ea 100644 --- a/test/SemaCXX/struct-class-redecl.cpp +++ b/test/SemaCXX/struct-class-redecl.cpp @@ -1,4 +1,4 @@ -// RUN: clang-cc -fsyntax-only -Wmismatched-tags -verify %s +// RUN: %clang_cc1 -fsyntax-only -Wmismatched-tags -verify %s class X; // expected-note 2{{here}} typedef struct X * X_t; // expected-warning{{previously declared}} diff --git a/test/SemaCXX/switch-0x.cpp b/test/SemaCXX/switch-0x.cpp index c1f6bd9d19a85..adaeb85bce17c 100644 --- a/test/SemaCXX/switch-0x.cpp +++ b/test/SemaCXX/switch-0x.cpp @@ -1,4 +1,4 @@ -// RUN: clang-cc -fsyntax-only -verify -std=c++0x %s +// RUN: %clang_cc1 -fsyntax-only -verify -std=c++0x %s // PR5518 struct A { diff --git a/test/SemaCXX/switch.cpp b/test/SemaCXX/switch.cpp index 003d5b8b9c082..c256960af1da4 100644 --- a/test/SemaCXX/switch.cpp +++ b/test/SemaCXX/switch.cpp @@ -1,4 +1,4 @@ -// RUN: clang-cc -fsyntax-only -verify %s +// RUN: %clang_cc1 -fsyntax-only -verify %s void test() { bool x = true; diff --git a/test/SemaCXX/this.cpp b/test/SemaCXX/this.cpp index 0577d3c2b9bf1..167755f0a74d0 100644 --- a/test/SemaCXX/this.cpp +++ b/test/SemaCXX/this.cpp @@ -1,4 +1,4 @@ -// RUN: clang-cc -fsyntax-only -verify %s +// RUN: %clang_cc1 -fsyntax-only -verify %s int x = this; // expected-error {{error: invalid use of 'this' outside of a nonstatic member function}} void f() { diff --git a/test/SemaCXX/trivial-constructor.cpp b/test/SemaCXX/trivial-constructor.cpp index 8fc14d9c82cb9..494d1ec0843f7 100644 --- a/test/SemaCXX/trivial-constructor.cpp +++ b/test/SemaCXX/trivial-constructor.cpp @@ -1,4 +1,4 @@ -// RUN: clang-cc -fsyntax-only -verify %s -std=c++0x +// RUN: %clang_cc1 -fsyntax-only -verify %s -std=c++0x struct T1 { }; static_assert(__has_trivial_constructor(T1), "T1 has trivial constructor!"); diff --git a/test/SemaCXX/trivial-destructor.cpp b/test/SemaCXX/trivial-destructor.cpp index 9e7f3a16dd66c..29358d8bd2280 100644 --- a/test/SemaCXX/trivial-destructor.cpp +++ b/test/SemaCXX/trivial-destructor.cpp @@ -1,4 +1,4 @@ -// RUN: clang-cc -fsyntax-only -verify %s -std=c++0x +// RUN: %clang_cc1 -fsyntax-only -verify %s -std=c++0x struct T1 { }; static_assert(__has_trivial_destructor(T1), "T1 has trivial destructor!"); diff --git a/test/SemaCXX/type-convert-construct.cpp b/test/SemaCXX/type-convert-construct.cpp index 1840456bde8e6..d786a9a8a6fc5 100644 --- a/test/SemaCXX/type-convert-construct.cpp +++ b/test/SemaCXX/type-convert-construct.cpp @@ -1,4 +1,4 @@ -// RUN: clang-cc -fsyntax-only -verify %s +// RUN: %clang_cc1 -fsyntax-only -verify %s void f() { float v1 = float(1); diff --git a/test/SemaCXX/type-definition-in-specifier.cpp b/test/SemaCXX/type-definition-in-specifier.cpp index 60c28b0f5e437..a614e6c2812ec 100644 --- a/test/SemaCXX/type-definition-in-specifier.cpp +++ b/test/SemaCXX/type-definition-in-specifier.cpp @@ -1,4 +1,4 @@ -// RUN: clang-cc -fsyntax-only -verify %s +// RUN: %clang_cc1 -fsyntax-only -verify %s struct S0; struct S1; diff --git a/test/SemaCXX/type-dependent-exprs.cpp b/test/SemaCXX/type-dependent-exprs.cpp index dd31ef020c6ae..abe1b4d730cae 100644 --- a/test/SemaCXX/type-dependent-exprs.cpp +++ b/test/SemaCXX/type-dependent-exprs.cpp @@ -1,4 +1,4 @@ -// RUN: clang-cc -fsyntax-only -verify %s +// RUN: %clang_cc1 -fsyntax-only -verify %s class X { public: virtual int f(); @@ -19,6 +19,6 @@ T f(T x) { return g(x); h(x); // h is a dependent name g(1, 1); // expected-error{{no matching function for call}} - h(1); // expected-error{{no matching function for call to 'h'}} + h(1); // expected-error{{use of undeclared identifier 'h'}} return 0; } diff --git a/test/SemaCXX/type-traits-incomplete.cpp b/test/SemaCXX/type-traits-incomplete.cpp index ac8ec452b93f8..0ef6917c5911c 100644 --- a/test/SemaCXX/type-traits-incomplete.cpp +++ b/test/SemaCXX/type-traits-incomplete.cpp @@ -1,4 +1,4 @@ -// RUN: clang-cc -fsyntax-only -verify %s +// RUN: %clang_cc1 -fsyntax-only -verify %s struct S; // expected-note{{forward declaration of 'struct S'}} diff --git a/test/SemaCXX/type-traits.cpp b/test/SemaCXX/type-traits.cpp index dfb4edce67c8e..85bd596126884 100644 --- a/test/SemaCXX/type-traits.cpp +++ b/test/SemaCXX/type-traits.cpp @@ -1,4 +1,4 @@ -// RUN: clang-cc -fsyntax-only -verify %s +// RUN: %clang_cc1 -fsyntax-only -verify %s #define T(b) (b) ? 1 : -1 #define F(b) (b) ? -1 : 1 @@ -257,4 +257,4 @@ template<typename> struct B : A { }; void f() { int t01[T(!__has_trivial_destructor(A))]; int t02[T(!__has_trivial_destructor(B<int>))]; -}
\ No newline at end of file +} diff --git a/test/SemaCXX/typedef-redecl.cpp b/test/SemaCXX/typedef-redecl.cpp index e38f47436d1c9..0d8dc8487bf71 100644 --- a/test/SemaCXX/typedef-redecl.cpp +++ b/test/SemaCXX/typedef-redecl.cpp @@ -1,4 +1,4 @@ -// RUN: clang-cc -fsyntax-only -verify %s +// RUN: %clang_cc1 -fsyntax-only -verify %s typedef int INT; typedef INT REALLY_INT; // expected-note {{previous definition is here}} typedef REALLY_INT REALLY_REALLY_INT; @@ -29,3 +29,11 @@ typedef I I; struct s { }; +// PR5874 +namespace test1 { + typedef int foo; + namespace a { using test1::foo; }; + typedef int foo; + using namespace a; + foo x; +} diff --git a/test/SemaCXX/typeid.cpp b/test/SemaCXX/typeid.cpp index f9ad7592187c0..7960cac783103 100644 --- a/test/SemaCXX/typeid.cpp +++ b/test/SemaCXX/typeid.cpp @@ -1,4 +1,4 @@ -// RUN: clang-cc -fsyntax-only -verify %s +// RUN: %clang_cc1 -fsyntax-only -verify %s void f() { @@ -14,3 +14,11 @@ void g() { (void)typeid(int); } + +struct X; // expected-note 3{{forward declaration}} + +void g1(X &x) { + (void)typeid(X); // expected-error{{'typeid' of incomplete type 'struct X'}} + (void)typeid(X&); // expected-error{{'typeid' of incomplete type 'struct X'}} + (void)typeid(x); // expected-error{{'typeid' of incomplete type 'struct X'}} +} diff --git a/test/SemaCXX/types_compatible_p.cpp b/test/SemaCXX/types_compatible_p.cpp index 30b16006c685b..4aa9a1cfa939b 100644 --- a/test/SemaCXX/types_compatible_p.cpp +++ b/test/SemaCXX/types_compatible_p.cpp @@ -1,4 +1,4 @@ -// RUN: clang-cc -fsyntax-only -verify %s +// RUN: %clang_cc1 -fsyntax-only -verify %s bool f() { return __builtin_types_compatible_p(int, const int); // expected-error{{C++}} diff --git a/test/SemaCXX/unknown-type-name.cpp b/test/SemaCXX/unknown-type-name.cpp index 0542129513384..084a81104d550 100644 --- a/test/SemaCXX/unknown-type-name.cpp +++ b/test/SemaCXX/unknown-type-name.cpp @@ -1,4 +1,4 @@ -// RUN: clang-cc -fsyntax-only -verify %s +// RUN: %clang_cc1 -fsyntax-only -verify %s // PR3990 namespace N { diff --git a/test/SemaCXX/unreachable-catch-clauses.cpp b/test/SemaCXX/unreachable-catch-clauses.cpp index c8b642e7ab535..9fc4aef44a040 100644 --- a/test/SemaCXX/unreachable-catch-clauses.cpp +++ b/test/SemaCXX/unreachable-catch-clauses.cpp @@ -1,4 +1,4 @@ -// RUN: clang-cc -fsyntax-only -verify %s +// RUN: %clang_cc1 -fsyntax-only -verify %s class BaseEx {}; class Ex1: public BaseEx {}; diff --git a/test/SemaCXX/unused.cpp b/test/SemaCXX/unused.cpp index 55f959de0f027..6fd108186afaf 100644 --- a/test/SemaCXX/unused.cpp +++ b/test/SemaCXX/unused.cpp @@ -1,4 +1,4 @@ -// RUN: clang-cc -fsyntax-only -verify %s +// RUN: %clang_cc1 -fsyntax-only -verify %s // PR4103 : Make sure we don't get a bogus unused expression warning class APInt { char foo; diff --git a/test/SemaCXX/user-defined-conversions.cpp b/test/SemaCXX/user-defined-conversions.cpp index 0a4bb773d396e..4367f4b8a3534 100644 --- a/test/SemaCXX/user-defined-conversions.cpp +++ b/test/SemaCXX/user-defined-conversions.cpp @@ -1,4 +1,4 @@ -// RUN: clang-cc -fsyntax-only -verify %s +// RUN: %clang_cc1 -fsyntax-only -verify %s struct X { operator bool(); }; diff --git a/test/SemaCXX/using-decl-1.cpp b/test/SemaCXX/using-decl-1.cpp index 0235624a8ea5e..e8a7d70976eca 100644 --- a/test/SemaCXX/using-decl-1.cpp +++ b/test/SemaCXX/using-decl-1.cpp @@ -1,4 +1,4 @@ -// RUN: clang-cc -fsyntax-only -verify %s +// RUN: %clang_cc1 -fsyntax-only -verify %s extern "C" { void f(bool); } @@ -42,3 +42,21 @@ struct X1 : X0 { struct A { void f(); }; struct B : A { }; class C : B { using B::f; }; + +// PR5751: Resolve overloaded functions through using decls. +namespace O { + void f(int i); + void f(double d); +} +namespace P { + void f(); + void g(void (*ptr)(int)); + using O::f; + void test() { + f(); + f(1); + void (*f_ptr1)(double) = f; + void (*f_ptr2)() = f; + g(f); + } +} diff --git a/test/SemaCXX/using-decl-pr4441.cpp b/test/SemaCXX/using-decl-pr4441.cpp index 6aa2b261e4db8..39a446fed9acd 100644 --- a/test/SemaCXX/using-decl-pr4441.cpp +++ b/test/SemaCXX/using-decl-pr4441.cpp @@ -1,4 +1,4 @@ -// RUN: clang-cc -fsyntax-only -verify %s +// RUN: %clang_cc1 -fsyntax-only -verify %s namespace A { struct B { }; diff --git a/test/SemaCXX/using-decl-pr4450.cpp b/test/SemaCXX/using-decl-pr4450.cpp index c3d5b8300624b..4f929ad15f5f4 100644 --- a/test/SemaCXX/using-decl-pr4450.cpp +++ b/test/SemaCXX/using-decl-pr4450.cpp @@ -1,4 +1,4 @@ -// RUN: clang-cc -fsyntax-only -verify %s +// RUN: %clang_cc1 -fsyntax-only -verify %s namespace A { void g(); diff --git a/test/SemaCXX/using-decl-templates.cpp b/test/SemaCXX/using-decl-templates.cpp index a19223d479d00..8f2876ce4b32a 100644 --- a/test/SemaCXX/using-decl-templates.cpp +++ b/test/SemaCXX/using-decl-templates.cpp @@ -1,4 +1,4 @@ -// RUN: clang-cc -fsyntax-only -verify %s +// RUN: %clang_cc1 -fsyntax-only -verify %s template<typename T> struct A { void f() { } diff --git a/test/SemaCXX/using-directive.cpp b/test/SemaCXX/using-directive.cpp index b7583f27cb64e..0d5c8400ab7ee 100644 --- a/test/SemaCXX/using-directive.cpp +++ b/test/SemaCXX/using-directive.cpp @@ -1,4 +1,4 @@ -// RUN: clang-cc -fsyntax-only -verify %s +// RUN: %clang_cc1 -fsyntax-only -verify %s namespace A { short i; // expected-note 2{{candidate found by name lookup is 'A::i'}} diff --git a/test/SemaCXX/value-dependent-exprs.cpp b/test/SemaCXX/value-dependent-exprs.cpp index c70f895d2bf94..2017ffa67c906 100644 --- a/test/SemaCXX/value-dependent-exprs.cpp +++ b/test/SemaCXX/value-dependent-exprs.cpp @@ -1,4 +1,4 @@ -// RUN: clang-cc -verify %s +// RUN: %clang_cc1 -verify %s template <unsigned I> class C0 { diff --git a/test/SemaCXX/value-initialization.cpp b/test/SemaCXX/value-initialization.cpp index 25d708494b1ac..d6a86c4c8cb5b 100644 --- a/test/SemaCXX/value-initialization.cpp +++ b/test/SemaCXX/value-initialization.cpp @@ -1,4 +1,4 @@ -// RUN: clang-cc -fsyntax-only -verify %s -std=c++0x +// RUN: %clang_cc1 -fsyntax-only -verify %s -std=c++0x struct A { // expected-error {{implicit default constructor for 'struct A' must explicitly initialize the const member 'i'}} const int i; // expected-note {{declared at}} diff --git a/test/SemaCXX/vararg-default-arg.cpp b/test/SemaCXX/vararg-default-arg.cpp index 5ba032027742b..3c8e41cb3e359 100644 --- a/test/SemaCXX/vararg-default-arg.cpp +++ b/test/SemaCXX/vararg-default-arg.cpp @@ -1,4 +1,4 @@ -// RUN: clang-cc %s -verify -fsyntax-only +// RUN: %clang_cc1 %s -verify -fsyntax-only // PR5462 void f1(void); diff --git a/test/SemaCXX/vararg-non-pod.cpp b/test/SemaCXX/vararg-non-pod.cpp index f913531a27d06..5f95446d41f25 100644 --- a/test/SemaCXX/vararg-non-pod.cpp +++ b/test/SemaCXX/vararg-non-pod.cpp @@ -1,4 +1,4 @@ -// RUN: clang-cc -fsyntax-only -verify -fblocks %s -Wnon-pod-varargs +// RUN: %clang_cc1 -fsyntax-only -verify -fblocks %s -Wnon-pod-varargs extern char version[]; diff --git a/test/SemaCXX/vector-casts.cpp b/test/SemaCXX/vector-casts.cpp index 5b08043545fa6..6ee619ef06478 100644 --- a/test/SemaCXX/vector-casts.cpp +++ b/test/SemaCXX/vector-casts.cpp @@ -1,4 +1,4 @@ -// RUN: clang-cc -fsyntax-only -verify %s +// RUN: %clang_cc1 -fsyntax-only -verify %s typedef int __v2si __attribute__((__vector_size__(8))); typedef short __v4hi __attribute__((__vector_size__(8))); typedef short __v8hi __attribute__((__vector_size__(16))); diff --git a/test/SemaCXX/virtual-member-functions-key-function.cpp b/test/SemaCXX/virtual-member-functions-key-function.cpp index 4e7ff69b2edfc..3d048595e94e0 100644 --- a/test/SemaCXX/virtual-member-functions-key-function.cpp +++ b/test/SemaCXX/virtual-member-functions-key-function.cpp @@ -1,4 +1,4 @@ -// RUN: clang-cc -fsyntax-only -verify %s +// RUN: %clang_cc1 -fsyntax-only -verify %s struct A { virtual ~A(); }; diff --git a/test/SemaCXX/virtual-override.cpp b/test/SemaCXX/virtual-override.cpp index c18a77f036bb6..4fdac85040be6 100644 --- a/test/SemaCXX/virtual-override.cpp +++ b/test/SemaCXX/virtual-override.cpp @@ -1,4 +1,4 @@ -// RUN: clang-cc -fsyntax-only -faccess-control -verify %s +// RUN: %clang_cc1 -fsyntax-only -faccess-control -verify %s namespace T1 { class A { @@ -104,6 +104,35 @@ namespace T7 { }; } +namespace T8 { + struct a { }; + struct b; // expected-note {{forward declaration of 'struct T8::b'}} + + class A { + virtual a *f(); + }; + + class B : A { + b* f(); // expected-error {{return type of virtual function 'f' is not covariant with the return type of the function it overrides ('struct T8::b' is incomplete)}} + }; +} + +namespace T9 { + struct a { }; + + template<typename T> struct b : a { + int a[sizeof(T) ? -1 : -1]; // expected-error {{array size is negative}} + }; + + class A { + virtual a *f(); + }; + + class B : A { + virtual b<int> *f(); // expected-note {{in instantiation of template class 'struct T9::b<int>' requested here}} + }; +} + // PR5656 class X0 { virtual void f0(); @@ -150,3 +179,21 @@ void test3() { Bar3<int> b3i; // okay Bar3<float> b3f; // expected-error{{is an abstract class}} } + +// 5920 +namespace PR5920 { + class Base {}; + + template <typename T> + class Derived : public Base {}; + + class Foo { + public: + virtual Base* Method(); + }; + + class Bar : public Foo { + public: + virtual Derived<int>* Method(); + }; +} diff --git a/test/SemaCXX/virtuals.cpp b/test/SemaCXX/virtuals.cpp index c2ac77b30479b..792467e5f86bf 100644 --- a/test/SemaCXX/virtuals.cpp +++ b/test/SemaCXX/virtuals.cpp @@ -1,4 +1,4 @@ -// RUN: clang-cc -fsyntax-only -verify %s +// RUN: %clang_cc1 -fsyntax-only -verify %s class A { virtual void f(); diff --git a/test/SemaCXX/warn-assignment-condition.cpp b/test/SemaCXX/warn-assignment-condition.cpp index 3b9f3066a16be..1df906dd7ec6c 100644 --- a/test/SemaCXX/warn-assignment-condition.cpp +++ b/test/SemaCXX/warn-assignment-condition.cpp @@ -1,4 +1,4 @@ -// RUN: clang-cc -fsyntax-only -Wparentheses -verify %s +// RUN: %clang_cc1 -fsyntax-only -Wparentheses -verify %s struct A { int foo(); diff --git a/test/SemaCXX/warn-char-subscripts.cpp b/test/SemaCXX/warn-char-subscripts.cpp index 1c06db91c3f75..84ea536b979e7 100644 --- a/test/SemaCXX/warn-char-subscripts.cpp +++ b/test/SemaCXX/warn-char-subscripts.cpp @@ -1,4 +1,4 @@ -// RUN: clang-cc -Wchar-subscripts -fsyntax-only -verify %s +// RUN: %clang_cc1 -Wchar-subscripts -fsyntax-only -verify %s template<typename T> void t1() { diff --git a/test/SemaCXX/warn-for-var-in-else.cpp b/test/SemaCXX/warn-for-var-in-else.cpp index c46b30640fb2b..1307c43bc20a8 100644 --- a/test/SemaCXX/warn-for-var-in-else.cpp +++ b/test/SemaCXX/warn-for-var-in-else.cpp @@ -1,4 +1,4 @@ -// RUN: clang-cc -fsyntax-only -verify %s +// RUN: %clang_cc1 -fsyntax-only -verify %s // rdar://6425550 int bar(); void do_something(int); diff --git a/test/SemaCXX/warn-missing-prototypes.cpp b/test/SemaCXX/warn-missing-prototypes.cpp index 079a83725223f..b6ebe820f39cd 100644 --- a/test/SemaCXX/warn-missing-prototypes.cpp +++ b/test/SemaCXX/warn-missing-prototypes.cpp @@ -1,4 +1,4 @@ -// RUN: clang-cc -fsyntax-only -verify -Wmissing-prototypes %s +// RUN: %clang_cc1 -fsyntax-only -verify -Wmissing-prototypes %s void f() { } // expected-warning {{no previous prototype for function 'f'}} diff --git a/test/SemaCXX/warn-reorder-ctor-initialization.cpp b/test/SemaCXX/warn-reorder-ctor-initialization.cpp index bfce588b570a8..35b32b26a0669 100644 --- a/test/SemaCXX/warn-reorder-ctor-initialization.cpp +++ b/test/SemaCXX/warn-reorder-ctor-initialization.cpp @@ -1,4 +1,4 @@ -// RUN: clang-cc -fsyntax-only -Wreorder -verify %s +// RUN: %clang_cc1 -fsyntax-only -Wreorder -verify %s struct BB {}; diff --git a/test/SemaCXX/warn-unused-variables.cpp b/test/SemaCXX/warn-unused-variables.cpp index 019863686d328..5620248f5005f 100644 --- a/test/SemaCXX/warn-unused-variables.cpp +++ b/test/SemaCXX/warn-unused-variables.cpp @@ -1,4 +1,4 @@ -// RUN: clang -fsyntax-only -Wunused-variable -verify %s +// RUN: %clang -fsyntax-only -Wunused-variable -verify %s template<typename T> void f() { T t; @@ -32,3 +32,14 @@ namespace PR5531 { C(); } } + + +struct X { + int foo() __attribute__((warn_unused_result)); +}; + +void bah() { + X x, *x2; + x.foo(); // expected-warning {{ignoring return value of function declared with warn_unused_result attribute}} + x2->foo(); // expected-warning {{ignoring return value of function declared with warn_unused_result attribute}} +} diff --git a/test/SemaCXX/wchar_t.cpp b/test/SemaCXX/wchar_t.cpp index cb85bc3ae729a..789dbf643863f 100644 --- a/test/SemaCXX/wchar_t.cpp +++ b/test/SemaCXX/wchar_t.cpp @@ -1,4 +1,4 @@ -// RUN: clang-cc -fsyntax-only -pedantic -verify %s +// RUN: %clang_cc1 -fsyntax-only -pedantic -verify %s wchar_t x; void f(wchar_t p) { @@ -11,3 +11,17 @@ void f(wchar_t p) { // PR4502 wchar_t const c = L'c'; int a[c == L'c' ? 1 : -1]; + + +// PR5917 +template<typename _CharT> +struct basic_string { +}; + +template<typename _CharT> +basic_string<_CharT> operator+ (const basic_string<_CharT>&, _CharT); + +int t(void) { + basic_string<wchar_t>() + L'-'; + return (0); +} |