diff options
Diffstat (limited to 'test/Misc')
-rw-r--r-- | test/Misc/ast-dump-wchar.cpp | 13 | ||||
-rw-r--r-- | test/Misc/diag-aka-types.cpp | 23 | ||||
-rw-r--r-- | test/Misc/diag-template-diffing-color.cpp | 19 | ||||
-rw-r--r-- | test/Misc/diag-template-diffing.cpp | 433 | ||||
-rw-r--r-- | test/Misc/diag-trailing-null-bytes.cpp | 10 | ||||
-rw-r--r-- | test/Misc/emit-html.c | 8 | ||||
-rw-r--r-- | test/Misc/integer-literal-printing.cpp | 4 | ||||
-rw-r--r-- | test/Misc/serialized-diags-frontend.c | 8 | ||||
-rw-r--r-- | test/Misc/show-diag-options.c | 2 | ||||
-rw-r--r-- | test/Misc/tabstop.c | 9 | ||||
-rw-r--r-- | test/Misc/warning-flags-enabled.c | 27 | ||||
-rw-r--r-- | test/Misc/warning-flags-tree.c | 56 | ||||
-rw-r--r-- | test/Misc/warning-flags.c | 103 | ||||
-rw-r--r-- | test/Misc/wnull-character.cpp | bin | 143 -> 0 bytes |
14 files changed, 594 insertions, 121 deletions
diff --git a/test/Misc/ast-dump-wchar.cpp b/test/Misc/ast-dump-wchar.cpp new file mode 100644 index 0000000..87d962f --- /dev/null +++ b/test/Misc/ast-dump-wchar.cpp @@ -0,0 +1,13 @@ +// RUN: %clang_cc1 -std=c++11 -ast-dump %s -triple x86_64-linux-gnu | FileCheck %s + +char c8[] = u8"test\0\\\"\t\a\b\234"; +// CHECK: char c8[12] = (StringLiteral {{.*}} lvalue u8"test\000\\\"\t\a\b\234") + +char16_t c16[] = u"test\0\\\"\t\a\b\234\u1234"; +// CHECK: char16_t c16[13] = (StringLiteral {{.*}} lvalue u"test\000\\\"\t\a\b\234\u1234") + +char32_t c32[] = U"test\0\\\"\t\a\b\234\u1234\U0010ffff"; // \ +// CHECK: char32_t c32[14] = (StringLiteral {{.*}} lvalue U"test\000\\\"\t\a\b\234\u1234\U0010FFFF") + +wchar_t wc[] = L"test\0\\\"\t\a\b\234\u1234\xffffffff"; // \ +// CHECK: wchar_t wc[14] = (StringLiteral {{.*}} lvalue L"test\000\\\"\t\a\b\234\x1234\xFFFFFFFF") diff --git a/test/Misc/diag-aka-types.cpp b/test/Misc/diag-aka-types.cpp index 4c9a731..3a00b71 100644 --- a/test/Misc/diag-aka-types.cpp +++ b/test/Misc/diag-aka-types.cpp @@ -30,27 +30,6 @@ void test(Foo::foo* x) { bar::f(x); // expected-error{{cannot initialize a parameter of type 'Foo::foo *' (aka 'bar::Foo::foo *') with an lvalue of type 'Foo::foo *'}} } -// PR9548 - "no known conversion from 'vector<string>' to 'vector<string>'" -// vector<string> refers to two different types here. Make sure the message -// gives a way to tell them apart. -class versa_string; -typedef versa_string string; - -namespace std {template <typename T> class vector;} -using std::vector; - -void f(vector<string> v); // expected-note {{candidate function not viable: no known conversion from 'vector<string>' (aka 'std::vector<std::basic_string>') to 'vector<string>' (aka 'std::vector<versa_string>') for 1st argument}} - -namespace std { - class basic_string; - typedef basic_string string; - template <typename T> class vector {}; - void g() { - vector<string> v; - f(v); // expected-error{{no matching function for call to 'f'}} - } -} - namespace ns { struct str { static void method(struct data *) {} @@ -61,7 +40,7 @@ struct data { int i; }; typedef void (*callback)(struct data *); -void helper(callback cb) {} // expected-note{{candidate function not viable: no known conversion from 'void (*)(struct data *)' (aka 'void (*)(ns::data *)') to 'callback' (aka 'void (*)(struct data *)') for 1st argument;}} +void helper(callback cb) {} // expected-note{{candidate function not viable: no known conversion from 'void (*)(struct data *)' (aka 'void (*)(ns::data *)') to 'callback' (aka 'void (*)(struct data *)') for 1st argument}} void test() { helper(&ns::str::method); // expected-error{{no matching function for call to 'helper'}} diff --git a/test/Misc/diag-template-diffing-color.cpp b/test/Misc/diag-template-diffing-color.cpp new file mode 100644 index 0000000..6903e84 --- /dev/null +++ b/test/Misc/diag-template-diffing-color.cpp @@ -0,0 +1,19 @@ +// RUN: %clang_cc1 -fsyntax-only -fcolor-diagnostics %s 2>&1 | FileCheck %s +// RUN: %clang_cc1 -fsyntax-only -fcolor-diagnostics -fdiagnostics-show-template-tree %s 2>&1 | FileCheck %s -check-prefix=TREE +// REQUIRES: ansi-escape-sequences +template<typename> struct foo {}; +void func(foo<int>); +int main() { + func(foo<double>()); +} +// CHECK: {{.*}}candidate function not viable: no known conversion from 'foo<{{.}}[0;1;36mdouble{{.}}[0m>' to 'foo<{{.}}[0;1;36mint{{.}}[0m>' for 1st argument{{.}}[0m +// TREE: candidate function not viable: no known conversion from argument type to parameter type for 1st argument +// TREE: foo< +// TREE: [{{.}}[0;1;36mdouble{{.}}[0m != {{.}}[0;1;36mint{{.}}[0m]>{{.}}[0m + +foo<int> A; +foo<double> &B = A; +// CHECK: {{.*}}non-const lvalue reference to type 'foo<{{.}}[0;1;36mdouble{{.}}[0m{{.}}[1m>' cannot bind to a value of unrelated type 'foo<{{.}}[0;1;36mint{{.}}[0m{{.}}[1m>'{{.}}[0m +// TREE: non-const lvalue reference cannot bind to a value of unrelated type +// TREE: foo< +// TREE: [{{.}}[0;1;36mdouble{{.}}[0m{{.}}[1m != {{.}}[0;1;36mint{{.}}[0m{{.}}[1m]>{{.}}[0m diff --git a/test/Misc/diag-template-diffing.cpp b/test/Misc/diag-template-diffing.cpp new file mode 100644 index 0000000..9addcc5 --- /dev/null +++ b/test/Misc/diag-template-diffing.cpp @@ -0,0 +1,433 @@ +// RUN: %clang_cc1 -fsyntax-only %s -std=c++11 2>&1 | FileCheck %s -check-prefix=CHECK-ELIDE-NOTREE +// RUN: %clang_cc1 -fsyntax-only %s -fno-elide-type -std=c++11 2>&1 | FileCheck %s -check-prefix=CHECK-NOELIDE-NOTREE +// RUN: %clang_cc1 -fsyntax-only %s -fdiagnostics-show-template-tree -std=c++11 2>&1 | FileCheck %s -check-prefix=CHECK-ELIDE-TREE +// RUN: %clang_cc1 -fsyntax-only %s -fno-elide-type -fdiagnostics-show-template-tree -std=c++11 2>&1 | FileCheck %s -check-prefix=CHECK-NOELIDE-TREE + +// PR9548 - "no known conversion from 'vector<string>' to 'vector<string>'" +// vector<string> refers to two different types here. Make sure the message +// gives a way to tell them apart. +class versa_string; +typedef versa_string string; + +namespace std {template <typename T> class vector;} +using std::vector; + +void f(vector<string> v); + +namespace std { + class basic_string; + typedef basic_string string; + template <typename T> class vector {}; + void g() { + vector<string> v; + f(v); + } +} // end namespace std +// CHECK-ELIDE-NOTREE: no matching function for call to 'f' +// CHECK-ELIDE-NOTREE: candidate function not viable: no known conversion from 'vector<class std::basic_string>' to 'vector<class versa_string>' for 1st argument +// CHECK-NOELIDE-NOTREE: no matching function for call to 'f' +// CHECK-NOELIDE-NOTREE: candidate function not viable: no known conversion from 'vector<class std::basic_string>' to 'vector<class versa_string>' for 1st argument +// CHECK-ELIDE-TREE: no matching function for call to 'f' +// CHECK-ELIDE-TREE: candidate function not viable: no known conversion from argument type to parameter type for 1st argument +// CHECK-ELIDE-TREE: vector< +// CHECK-ELIDE-TREE: [class std::basic_string != class versa_string]> +// CHECK-NOELIDE-TREE: no matching function for call to 'f' +// CHECK-NOELIDE-TREE: candidate function not viable: no known conversion from argument type to parameter type for 1st argument +// CHECK-NOELIDE-TREE: vector< +// CHECK-NOELIDE-TREE: [class std::basic_string != class versa_string]> + +template <int... A> +class I1{}; +void set1(I1<1,2,3,4,2,3,4,3>) {}; +void test1() { + set1(I1<1,2,3,4,2,2,4,3,7>()); +} +// CHECK-ELIDE-NOTREE: no matching function for call to 'set1' +// CHECK-ELIDE-NOTREE: candidate function not viable: no known conversion from 'I1<[5 * ...], 2, [2 * ...], 7>' to 'I1<[5 * ...], 3, [2 * ...], (no argument)>' for 1st argument +// CHECK-NOELIDE-NOTREE: no matching function for call to 'set1' +// CHECK-NOELIDE-NOTREE: candidate function not viable: no known conversion from 'I1<1, 2, 3, 4, 2, 2, 4, 3, 7>' to 'I1<1, 2, 3, 4, 2, 3, 4, 3, (no argument)>' for 1st argument +// CHECK-ELIDE-TREE: no matching function for call to 'set1' +// CHECK-ELIDE-TREE: candidate function not viable: no known conversion from argument type to parameter type for 1st argument +// CHECK-ELIDE-TREE: I1< +// CHECK-ELIDE-TREE: [5 * ...], +// CHECK-ELIDE-TREE: [2 != 3], +// CHECK-ELIDE-TREE: [2 * ...], +// CHECK-ELIDE-TREE: [7 != (no argument)]> +// CHECK-NOELIDE-TREE: no matching function for call to 'set1' +// CHECK-NOELIDE-TREE: candidate function not viable: no known conversion from argument type to parameter type for 1st argument +// CHECK-NOELIDE-TREE: I1< +// CHECK-NOELIDE-TREE: 1, +// CHECK-NOELIDE-TREE: 2, +// CHECK-NOELIDE-TREE: 3, +// CHECK-NOELIDE-TREE: 4, +// CHECK-NOELIDE-TREE: 2, +// CHECK-NOELIDE-TREE: [2 != 3], +// CHECK-NOELIDE-TREE: 4, +// CHECK-NOELIDE-TREE: 3, +// CHECK-NOELIDE-TREE: [7 != (no argument)]> + +template <class A, class B, class C = void> +class I2{}; +void set2(I2<int, int>) {}; +void test2() { + set2(I2<double, int, int>()); +} +// CHECK-ELIDE-NOTREE: no matching function for call to 'set2' +// CHECK-ELIDE-NOTREE: candidate function not viable: no known conversion from 'I2<double, [...], int>' to 'I2<int, [...], (default) void>' for 1st argument +// CHECK-NOELIDE-NOTREE: no matching function for call to 'set2' +// CHECK-NOELIDE-NOTREE: candidate function not viable: no known conversion from 'I2<double, int, int>' to 'I2<int, int, (default) void>' for 1st argument +// CHECK-ELIDE-TREE: no matching function for call to 'set2' +// CHECK-ELIDE-TREE: candidate function not viable: no known conversion from argument type to parameter type for 1st argument +// CHECK-ELIDE-TREE: I2< +// CHECK-ELIDE-TREE: [double != int], +// CHECK-ELIDE-TREE: [...], +// CHECK-ELIDE-TREE: [int != (default) void]> +// CHECK-NOELIDE-TREE: no matching function for call to 'set2' +// CHECK-NOELIDE-TREE: candidate function not viable: no known conversion from argument type to parameter type for 1st argument +// CHECK-NOELIDE-TREE: I2< +// CHECK-NOELIDE-TREE: [double != int], +// CHECK-NOELIDE-TREE: int, +// CHECK-NOELIDE-TREE: [int != (default) void]> + +int V1, V2, V3; +template <int* A, int *B> +class I3{}; +void set3(I3<&V1, &V2>) {}; +void test3() { + set3(I3<&V3, &V2>()); +} +// CHECK-ELIDE-NOTREE: no matching function for call to 'set3' +// CHECK-ELIDE-NOTREE: candidate function not viable: no known conversion from 'I3<&V3, [...]>' to 'I3<&V1, [...]>' for 1st argument +// CHECK-NOELIDE-NOTREE: no matching function for call to 'set3' +// CHECK-NOELIDE-NOTREE: candidate function not viable: no known conversion from 'I3<&V3, &V2>' to 'I3<&V1, &V2>' for 1st argument +// CHECK-ELIDE-TREE: no matching function for call to 'set3' +// CHECK-ELIDE-TREE: candidate function not viable: no known conversion from argument type to parameter type for 1st argument +// CHECK-ELIDE-TREE: I3< +// CHECK-ELIDE-TREE: [&V3 != &V1] +// CHECK-ELIDE-TREE: [...]> +// CHECK-NOELIDE-TREE: no matching function for call to 'set3' +// CHECK-NOELIDE-TREE: candidate function not viable: no known conversion from argument type to parameter type for 1st argument +// CHECK-NOELIDE-TREE: I3< +// CHECK-NOELIDE-TREE: [&V3 != &V1] +// CHECK-NOELIDE-TREE: &V2> + +template <class A, class B> +class Alpha{}; +template <class A, class B> +class Beta{}; +template <class A, class B> +class Gamma{}; +template <class A, class B> +class Delta{}; + +void set4(Alpha<int, int>); +void test4() { + set4(Beta<void, void>()); +} +// CHECK-ELIDE-NOTREE: no matching function for call to 'set4' +// CHECK-ELIDE-NOTREE: candidate function not viable: no known conversion from 'Beta<void, void>' to 'Alpha<int, int>' for 1st argument +// CHECK-NOELIDE-NOTREE: no matching function for call to 'set4' +// CHECK-NOELIDE-NOTREE: candidate function not viable: no known conversion from 'Beta<void, void>' to 'Alpha<int, int>' for 1st argument +// CHECK-ELIDE-TREE: no matching function for call to 'set4' +// CHECK-ELIDE-TREE: candidate function not viable: no known conversion from 'Beta<void, void>' to 'Alpha<int, int>' for 1st argument +// CHECK-NOELIDE-TREE: no matching function for call to 'set4' +// CHECK-NOELIDE-TREE: candidate function not viable: no known conversion from 'Beta<void, void>' to 'Alpha<int, int>' for 1st argument + +void set5(Alpha<Beta<Gamma<Delta<int, int>, int>, int>, int>); +void test5() { + set5(Alpha<Beta<Gamma<void, void>, double>, double>()); +} +// CHECK-ELIDE-NOTREE: no matching function for call to 'set5' +// CHECK-ELIDE-NOTREE: candidate function not viable: no known conversion from 'Alpha<Beta<Gamma<void, void>, double>, double>' to 'Alpha<Beta<Gamma<Delta<int, int>, int>, int>, int>' for 1st argument +// CHECK-NOELIDE-NOTREE: no matching function for call to 'set5' +// CHECK-NOELIDE-NOTREE: candidate function not viable: no known conversion from 'Alpha<Beta<Gamma<void, void>, double>, double>' to 'Alpha<Beta<Gamma<Delta<int, int>, int>, int>, int>' for 1st argument +// CHECK-ELIDE-TREE: no matching function for call to 'set5' +// CHECK-ELIDE-TREE: candidate function not viable: no known conversion from argument type to parameter type for 1st argument +// CHECK-ELIDE-TREE: Alpha< +// CHECK-ELIDE-TREE: Beta< +// CHECK-ELIDE-TREE: Gamma< +// CHECK-ELIDE-TREE: [void != Delta<int, int>], +// CHECK-ELIDE-TREE: [void != int]> +// CHECK-ELIDE-TREE: [double != int]> +// CHECK-ELIDE-TREE: [double != int]> +// CHECK-NOELIDE-TREE: no matching function for call to 'set5' +// CHECK-NOELIDE-TREE: candidate function not viable: no known conversion from argument type to parameter type for 1st argument +// CHECK-NOELIDE-TREE: Alpha< +// CHECK-NOELIDE-TREE: Beta< +// CHECK-NOELIDE-TREE: Gamma< +// CHECK-NOELIDE-TREE: [void != Delta<int, int>], +// CHECK-NOELIDE-TREE: [void != int]> +// CHECK-NOELIDE-TREE: [double != int]> +// CHECK-NOELIDE-TREE: [double != int]> + +void test6() { + set5(Alpha<Beta<Delta<int, int>, int>, int>()); +} +// CHECK-ELIDE-NOTREE: no matching function for call to 'set5' +// CHECK-ELIDE-NOTREE: candidate function not viable: no known conversion from 'Alpha<Beta<Delta<int, int>, [...]>, [...]>' to 'Alpha<Beta<Gamma<Delta<int, int>, int>, [...]>, [...]>' for 1st argument +// CHECK-NOELIDE-NOTREE: no matching function for call to 'set5' +// CHECK-NOELIDE-NOTREE: candidate function not viable: no known conversion from 'Alpha<Beta<Delta<int, int>, int>, int>' to 'Alpha<Beta<Gamma<Delta<int, int>, int>, int>, int>' for 1st argument +// CHECK-ELIDE-TREE: no matching function for call to 'set5' +// CHECK-ELIDE-TREE: candidate function not viable: no known conversion from argument type to parameter type for 1st argument +// CHECK-ELIDE-TREE: Alpha< +// CHECK-ELIDE-TREE: Beta< +// CHECK-ELIDE-TREE: [Delta<int, int> != Gamma<Delta<int, int>, int>], +// CHECK-ELIDE-TREE: [...]> +// CHECK-ELIDE-TREE: [...]> +// CHECK-NOELIDE-TREE: no matching function for call to 'set5' +// CHECK-NOELIDE-TREE: candidate function not viable: no known conversion from argument type to parameter type for 1st argument +// CHECK-NOELIDE-TREE: Alpha< +// CHECK-NOELIDE-TREE: Beta< +// CHECK-NOELIDE-TREE: [Delta<int, int> != Gamma<Delta<int, int>, int>], +// CHECK-NOELIDE-TREE: int> +// CHECK-NOELIDE-TREE: int> + +int a7, b7; +int c7[] = {1,2,3}; +template<int *A> +class class7 {}; +void set7(class7<&a7> A) {} +void test7() { + set7(class7<&a7>()); + set7(class7<&b7>()); + set7(class7<c7>()); + set7(class7<nullptr>()); +} +// CHECK-ELIDE-NOTREE: no matching function for call to 'set7' +// CHECK-ELIDE-NOTREE: candidate function not viable: no known conversion from 'class7<&b7>' to 'class7<&a7>' for 1st argument +// CHECK-ELIDE-NOTREE: no matching function for call to 'set7' +// CHECK-ELIDE-NOTREE: candidate function not viable: no known conversion from 'class7<c7>' to 'class7<&a7>' for 1st argument +// CHECK-ELIDE-NOTREE: no matching function for call to 'set7' +// CHECK-ELIDE-NOTREE: candidate function not viable: no known conversion from 'class7<nullptr>' to 'class7<&a7>' for 1st argument +// CHECK-NOELIDE-NOTREE: no matching function for call to 'set7' +// CHECK-NOELIDE-NOTREE: candidate function not viable: no known conversion from 'class7<&b7>' to 'class7<&a7>' for 1st argument +// CHECK-NOELIDE-NOTREE: no matching function for call to 'set7' +// CHECK-NOELIDE-NOTREE: candidate function not viable: no known conversion from 'class7<c7>' to 'class7<&a7>' for 1st argument +// CHECK-NOELIDE-NOTREE: no matching function for call to 'set7' +// CHECK-NOELIDE-NOTREE: candidate function not viable: no known conversion from 'class7<nullptr>' to 'class7<&a7>' for 1st argument +// CHECK-ELIDE-TREE: no matching function for call to 'set7' +// CHECK-ELIDE-TREE: candidate function not viable: no known conversion from argument type to parameter type for 1st argument +// CHECK-ELIDE-TREE: class7< +// CHECK-ELIDE-TREE: [&b7 != &a7]> +// CHECK-ELIDE-TREE: no matching function for call to 'set7' +// CHECK-ELIDE-TREE: candidate function not viable: no known conversion from argument type to parameter type for 1st argument +// CHECK-ELIDE-TREE: class7< +// CHECK-ELIDE-TREE: [c7 != &a7]> +// CHECK-ELIDE-TREE: no matching function for call to 'set7' +// CHECK-ELIDE-TREE: candidate function not viable: no known conversion from argument type to parameter type for 1st argument +// CHECK-ELIDE-TREE: class7< +// CHECK-ELIDE-TREE: [nullptr != &a7]> +// CHECK-NOELIDE-TREE: no matching function for call to 'set7' +// CHECK-NOELIDE-TREE: candidate function not viable: no known conversion from argument type to parameter type for 1st argument +// CHECK-NOELIDE-TREE: class7< +// CHECK-NOELIDE-TREE: [&b7 != &a7]> +// CHECK-NOELIDE-TREE: no matching function for call to 'set7' +// CHECK-NOELIDE-TREE: candidate function not viable: no known conversion from argument type to parameter type for 1st argument +// CHECK-NOELIDE-TREE: class7< +// CHECK-NOELIDE-TREE: [c7 != &a7]> +// CHECK-NOELIDE-TREE: no matching function for call to 'set7' +// CHECK-NOELIDE-TREE: candidate function not viable: no known conversion from argument type to parameter type for 1st argument +// CHECK-NOELIDE-TREE: class7< +// CHECK-NOELIDE-TREE: [nullptr != &a7]> + +template<typename ...T> struct S8 {}; +template<typename T> using U8 = S8<int, char, T>; +int f8(S8<int, char, double>); +int k8 = f8(U8<char>()); +// CHECK-ELIDE-NOTREE: no matching function for call to 'f8' +// CHECK-ELIDE-NOTREE: candidate function not viable: no known conversion from 'S8<[2 * ...], char>' to 'S8<[2 * ...], double>' for 1st argument +// CHECK-NOELIDE-NOTREE: no matching function for call to 'f8' +// CHECK-NOELIDE-NOTREE: candidate function not viable: no known conversion from 'S8<int, char, char>' to 'S8<int, char, double>' for 1st argument +// CHECK-ELIDE-TREE: no matching function for call to 'f8' +// CHECK-ELIDE-TREE: candidate function not viable: no known conversion from argument type to parameter type for 1st argument +// CHECK-ELIDE-TREE: S8< +// CHECK-ELIDE-TREE: [2 * ...], +// CHECK-ELIDE-TREE: [char != double]> +// CHECK-NOELIDE-TREE: no matching function for call to 'f8' +// CHECK-NOELIDE-TREE: candidate function not viable: no known conversion from argument type to parameter type for 1st argument +// CHECK-NOELIDE-TREE: S8< +// CHECK-NOELIDE-TREE: int, +// CHECK-NOELIDE-TREE: char, +// CHECK-NOELIDE-TREE: [char != double]> + +template<typename ...T> struct S9 {}; +template<typename T> using U9 = S9<int, char, T>; +template<typename T> using V9 = U9<U9<T>>; +int f9(S9<int, char, U9<const double>>); +int k9 = f9(V9<double>()); + +// CHECK-ELIDE-NOTREE: no matching function for call to 'f9' +// CHECK-ELIDE-NOTREE: candidate function not viable: no known conversion from 'S9<[2 * ...], S9<[2 * ...], double>>' to 'S9<[2 * ...], S9<[2 * ...], const double>>' for 1st argument +// CHECK-NOELIDE-NOTREE: no matching function for call to 'f9' +// CHECK-NOELIDE-NOTREE: candidate function not viable: no known conversion from 'S9<int, char, S9<int, char, double>>' to 'S9<int, char, S9<int, char, const double>>' for 1st argument +// CHECK-ELIDE-TREE: no matching function for call to 'f9' +// CHECK-ELIDE-TREE: candidate function not viable: no known conversion from argument type to parameter type for 1st argument +// CHECK-ELIDE-TREE: S9< +// CHECK-ELIDE-TREE: [2 * ...], +// CHECK-ELIDE-TREE: S9< +// CHECK-ELIDE-TREE: [2 * ...], +// CHECK-ELIDE-TREE: [double != const double]>> +// CHECK-NOELIDE-TREE: no matching function for call to 'f9' +// CHECK-NOELIDE-TREE: candidate function not viable: no known conversion from argument type to parameter type for 1st argument +// CHECK-NOELIDE-TREE: S9< +// CHECK-NOELIDE-TREE: int, +// CHECK-NOELIDE-TREE: char, +// CHECK-NOELIDE-TREE: S9< +// CHECK-NOELIDE-TREE: int, +// CHECK-NOELIDE-TREE: char, +// CHECK-NOELIDE-TREE: [double != const double]>> + +template<typename ...A> class class_types {}; +void set10(class_types<int, int>) {} +void test10() { + set10(class_types<int>()); + set10(class_types<int, int, int>()); +} + +// CHECK-ELIDE-NOTREE: no matching function for call to 'set10' +// CHECK-ELIDE-NOTREE: candidate function not viable: no known conversion from 'class_types<[...], (no argument)>' to 'class_types<[...], int>' for 1st argument +// CHECK-ELIDE-NOTREE: no matching function for call to 'set10' +// CHECK-ELIDE-NOTREE: candidate function not viable: no known conversion from 'class_types<[2 * ...], int>' to 'class_types<[2 * ...], (no argument)>' for 1st argument +// CHECK-NOELIDE-NOTREE: no matching function for call to 'set10' +// CHECK-NOELIDE-NOTREE: candidate function not viable: no known conversion from 'class_types<int, (no argument)>' to 'class_types<int, int>' for 1st argument +// CHECK-NOELIDE-NOTREE: no matching function for call to 'set10' +// CHECK-NOELIDE-NOTREE: candidate function not viable: no known conversion from 'class_types<int, int, int>' to 'class_types<int, int, (no argument)>' for 1st argument +// CHECK-ELIDE-TREE: no matching function for call to 'set10' +// CHECK-ELIDE-TREE: candidate function not viable: no known conversion from argument type to parameter type for 1st argument +// CHECK-ELIDE-TREE: class_types< +// CHECK-ELIDE-TREE: [...], +// CHECK-ELIDE-TREE: [(no argument) != int]> +// CHECK-ELIDE-TREE: no matching function for call to 'set10' +// CHECK-ELIDE-TREE: candidate function not viable: no known conversion from argument type to parameter type for 1st argument +// CHECK-ELIDE-TREE: class_types< +// CHECK-ELIDE-TREE: [2 * ...], +// CHECK-ELIDE-TREE: [int != (no argument)]> +// CHECK-NOELIDE-TREE: no matching function for call to 'set10' +// CHECK-NOELIDE-TREE: candidate function not viable: no known conversion from argument type to parameter type for 1st argument +// CHECK-NOELIDE-TREE: class_types< +// CHECK-NOELIDE-TREE: int, +// CHECK-NOELIDE-TREE: [(no argument) != int]> +// CHECK-NOELIDE-TREE: no matching function for call to 'set10' +// CHECK-NOELIDE-TREE: candidate function not viable: no known conversion from argument type to parameter type for 1st argument +// CHECK-NOELIDE-TREE: class_types< +// CHECK-NOELIDE-TREE: int, +// CHECK-NOELIDE-TREE: int, +// CHECK-NOELIDE-TREE: [int != (no argument)]> + +template<int ...A> class class_ints {}; +void set11(class_ints<2, 3>) {} +void test11() { + set11(class_ints<1>()); + set11(class_ints<0, 3, 6>()); +} +// CHECK-ELIDE-NOTREE: no matching function for call to 'set11' +// CHECK-ELIDE-NOTREE: candidate function not viable: no known conversion from 'class_ints<1, (no argument)>' to 'class_ints<2, 3>' for 1st argument +// CHECK-ELIDE-NOTREE: no matching function for call to 'set11' +// CHECK-ELIDE-NOTREE: candidate function not viable: no known conversion from 'class_ints<0, [...], 6>' to 'class_ints<2, [...], (no argument)>' for 1st argument +// CHECK-NOELIDE-NOTREE: no matching function for call to 'set11' +// CHECK-NOELIDE-NOTREE: candidate function not viable: no known conversion from 'class_ints<1, (no argument)>' to 'class_ints<2, 3>' for 1st argument +// CHECK-NOELIDE-NOTREE: no matching function for call to 'set11' +// CHECK-NOELIDE-NOTREE: candidate function not viable: no known conversion from 'class_ints<0, 3, 6>' to 'class_ints<2, 3, (no argument)>' for 1st argument +// CHECK-ELIDE-TREE: no matching function for call to 'set11' +// CHECK-ELIDE-TREE: candidate function not viable: no known conversion from argument type to parameter type for 1st argument +// CHECK-ELIDE-TREE: class_ints< +// CHECK-ELIDE-TREE: [1 != 2], +// CHECK-ELIDE-TREE: [(no argument) != 3]> +// CHECK-ELIDE-TREE: no matching function for call to 'set11' +// CHECK-ELIDE-TREE: candidate function not viable: no known conversion from argument type to parameter type for 1st argument +// CHECK-ELIDE-TREE: class_ints< +// CHECK-ELIDE-TREE: [0 != 2], +// CHECK-ELIDE-TREE: [...], +// CHECK-ELIDE-TREE: [6 != (no argument)]> +// CHECK-NOELIDE-TREE: no matching function for call to 'set11' +// CHECK-NOELIDE-TREE: candidate function not viable: no known conversion from argument type to parameter type for 1st argument +// CHECK-NOELIDE-TREE: class_ints< +// CHECK-NOELIDE-TREE: [1 != 2], +// CHECK-NOELIDE-TREE: [(no argument) != 3]> +// CHECK-NOELIDE-TREE: no matching function for call to 'set11' +// CHECK-NOELIDE-TREE: candidate function not viable: no known conversion from argument type to parameter type for 1st argument +// CHECK-NOELIDE-TREE: class_ints< +// CHECK-NOELIDE-TREE: [0 != 2], +// CHECK-NOELIDE-TREE: 3, +// CHECK-NOELIDE-TREE: [6 != (no argument)]> + +template<template<class> class ...A> class class_template_templates {}; +template<class> class tt1 {}; +template<class> class tt2 {}; +void set12(class_template_templates<tt1, tt1>) {} +void test12() { + set12(class_template_templates<tt2>()); + set12(class_template_templates<tt1, tt1, tt1>()); +} +// CHECK-ELIDE-NOTREE: no matching function for call to 'set12' +// CHECK-ELIDE-NOTREE: candidate function not viable: no known conversion from 'class_template_templates<template tt2, template (no argument)>' to 'class_template_templates<template tt1, template tt1>' for 1st argument +// CHECK-ELIDE-NOTREE: no matching function for call to 'set12' +// CHECK-ELIDE-NOTREE: candidate function not viable: no known conversion from 'class_template_templates<[2 * ...], template tt1>' to 'class_template_templates<[2 * ...], template (no argument)>' for 1st argument +// CHECK-NOELIDE-NOTREE: no matching function for call to 'set12' +// CHECK-NOELIDE-NOTREE: candidate function not viable: no known conversion from 'class_template_templates<template tt2, template (no argument)>' to 'class_template_templates<template tt1, template tt1>' for 1st argument +// CHECK-NOELIDE-NOTREE: no matching function for call to 'set12' +// CHECK-NOELIDE-NOTREE: candidate function not viable: no known conversion from 'class_template_templates<template tt1, template tt1, template tt1>' to 'class_template_templates<template tt1, template tt1, template (no argument)>' for 1st argument +// CHECK-ELIDE-TREE: no matching function for call to 'set12' +// CHECK-ELIDE-TREE: candidate function not viable: no known conversion from argument type to parameter type for 1st argument +// CHECK-ELIDE-TREE: class_template_templates< +// CHECK-ELIDE-TREE: [template tt2 != template tt1], +// CHECK-ELIDE-TREE: [template (no argument) != template tt1]> +// CHECK-ELIDE-TREE: no matching function for call to 'set12' +// CHECK-ELIDE-TREE: candidate function not viable: no known conversion from argument type to parameter type for 1st argument +// CHECK-ELIDE-TREE: class_template_templates< +// CHECK-ELIDE-TREE: [2 * ...], +// CHECK-ELIDE-TREE: [template tt1 != template (no argument)]> +// CHECK-NOELIDE-TREE: no matching function for call to 'set12' +// CHECK-NOELIDE-TREE: candidate function not viable: no known conversion from argument type to parameter type for 1st argument +// CHECK-NOELIDE-TREE: class_template_templates< +// CHECK-NOELIDE-TREE: [template tt2 != template tt1], +// CHECK-NOELIDE-TREE: [template (no argument) != template tt1]> +// CHECK-NOELIDE-TREE: no matching function for call to 'set12' +// CHECK-NOELIDE-TREE: candidate function not viable: no known conversion from argument type to parameter type for 1st argument +// CHECK-NOELIDE-TREE: class_template_templates< +// CHECK-NOELIDE-TREE: template tt1, +// CHECK-NOELIDE-TREE: template tt1, +// CHECK-NOELIDE-TREE: [template tt1 != template (no argument)]> + +double a13, b13, c13, d13; +template<double* ...A> class class_ptrs {}; +void set13(class_ptrs<&a13, &b13>) {} +void test13() { + set13(class_ptrs<&c13>()); + set13(class_ptrss<&a13, &b13, &d13>()); +} +// CHECK-ELIDE-NOTREE: no matching function for call to 'set13' +// CHECK-ELIDE-NOTREE: candidate function not viable: no known conversion from 'class_ptrs<&c13, (no argument)>' to 'class_ptrs<&a13, &b13>' for 1st argument +// CHECK-ELIDE-NOTREE: no matching function for call to 'set13' +// CHECK-ELIDE-NOTREE: candidate function not viable: no known conversion from 'class_ptrs<[2 * ...], &d13>' to 'class_ptrs<[2 * ...], (no argument)>' for 1st argument +// CHECK-NOELIDE-NOTREE: no matching function for call to 'set13' +// CHECK-NOELIDE-NOTREE: candidate function not viable: no known conversion from 'class_ptrs<&c13, (no argument)>' to 'class_ptrs<&a13, &b13>' for 1st argument +// CHECK-NOELIDE-NOTREE: no matching function for call to 'set13' +// CHECK-NOELIDE-NOTREE: candidate function not viable: no known conversion from 'class_ptrs<&a13, &b13, &d13>' to 'class_ptrs<&a13, &b13, (no argument)>' for 1st argument +// CHECK-ELIDE-TREE: no matching function for call to 'set13' +// CHECK-ELIDE-TREE: candidate function not viable: no known conversion from argument type to parameter type for 1st argument +// CHECK-ELIDE-TREE: class_ptrs< +// CHECK-ELIDE-TREE: [&c13 != &a13], +// CHECK-ELIDE-TREE: [(no argument) != &b13]> +// CHECK-ELIDE-TREE: no matching function for call to 'set13' +// CHECK-ELIDE-TREE: candidate function not viable: no known conversion from argument type to parameter type for 1st argument +// CHECK-ELIDE-TREE: class_ptrs< +// CHECK-ELIDE-TREE: [2 * ...], +// CHECK-ELIDE-TREE: [&d13 != (no argument)]> +// CHECK-NOELIDE-TREE: no matching function for call to 'set13' +// CHECK-NOELIDE-TREE: candidate function not viable: no known conversion from argument type to parameter type for 1st argument +// CHECK-NOELIDE-TREE: class_ptrs< +// CHECK-NOELIDE-TREE: [&c13 != &a13], +// CHECK-NOELIDE-TREE: [(no argument) != &b13]> +// CHECK-NOELIDE-TREE: no matching function for call to 'set13' +// CHECK-NOELIDE-TREE: candidate function not viable: no known conversion from argument type to parameter type for 1st argument +// CHECK-NOELIDE-TREE: class_ptrs< +// CHECK-NOELIDE-TREE: &a13, +// CHECK-NOELIDE-TREE: &b13, +// CHECK-NOELIDE-TREE: [&d13 != (no argument)]> + + +// CHECK-ELIDE-NOTREE: {{[0-9]*}} errors generated. +// CHECK-NOELIDE-NOTREE: {{[0-9]*}} errors generated. +// CHECK-ELIDE-TREE: {{[0-9]*}} errors generated. +// CHECK-NOELIDE-TREE: {{[0-9]*}} errors generated. diff --git a/test/Misc/diag-trailing-null-bytes.cpp b/test/Misc/diag-trailing-null-bytes.cpp new file mode 100644 index 0000000..91b159c --- /dev/null +++ b/test/Misc/diag-trailing-null-bytes.cpp @@ -0,0 +1,10 @@ +// RUN: %clang_cc1 -fsyntax-only %s 2>&1 | FileCheck -strict-whitespace %s +// CHECK: {{ERR_DNS_SERVER_REQUIRES_TCP$}} + +// http://llvm.org/PR12674 +#define NET_ERROR(label, value) ERR_ ## label = value, + +NET_ERROR(DNS_SERVER_REQUIRES_TCP, -801) + +#undef NET_ERROR + diff --git a/test/Misc/emit-html.c b/test/Misc/emit-html.c index 48c8b61..ec07a60 100644 --- a/test/Misc/emit-html.c +++ b/test/Misc/emit-html.c @@ -16,3 +16,11 @@ int main(int argc, char **argv) { FOR_ALL_FILES(f) { } #endif +// <rdar://problem/11625964> +// -emit-html filters out # directives, but not _Pragma (or MS __pragma) +// Diagnostic push/pop is stateful, so re-lexing a file can cause problems +// if these pragmas are interpreted normally. +_Pragma("clang diagnostic push") +_Pragma("clang diagnostic ignored \"-Wformat-extra-args\"") +_Pragma("clang diagnostic pop") + diff --git a/test/Misc/integer-literal-printing.cpp b/test/Misc/integer-literal-printing.cpp index d751730..4085d60 100644 --- a/test/Misc/integer-literal-printing.cpp +++ b/test/Misc/integer-literal-printing.cpp @@ -2,10 +2,10 @@ // PR11179 template <short T> class Type1 {}; -template <short T> void Function1(Type1<T>& x) {} // expected-note{{candidate function [with T = -42] not viable: no known conversion from 'Type1<-42>' to 'Type1<-42> &' for 1st argument;}} +template <short T> void Function1(Type1<T>& x) {} // expected-note{{candidate function [with T = -42] not viable: expects an l-value for 1st argument}} template <unsigned short T> class Type2 {}; -template <unsigned short T> void Function2(Type2<T>& x) {} // expected-note{{candidate function [with T = 42] not viable: no known conversion from 'Type2<42>' to 'Type2<42> &' for 1st argument;}} +template <unsigned short T> void Function2(Type2<T>& x) {} // expected-note{{candidate function [with T = 42] not viable: expects an l-value for 1st argument}} void Function() { Function1(Type1<-42>()); // expected-error{{no matching function for call to 'Function1'}} diff --git a/test/Misc/serialized-diags-frontend.c b/test/Misc/serialized-diags-frontend.c new file mode 100644 index 0000000..453ed14 --- /dev/null +++ b/test/Misc/serialized-diags-frontend.c @@ -0,0 +1,8 @@ +// RUN: rm -f %t +// RUN: %clang -fsyntax-only %s -Wblahblah --serialize-diagnostics %t > /dev/null 2>&1 || true +// RUN: c-index-test -read-diagnostics %t 2>&1 | FileCheck %s + +// This test case tests that we can handle frontend diagnostics. + +// CHECK: warning: unknown warning option '-Wblahblah' +// CHECK: Number of diagnostics: 1 diff --git a/test/Misc/show-diag-options.c b/test/Misc/show-diag-options.c index f0404a8..ef0a5a6 100644 --- a/test/Misc/show-diag-options.c +++ b/test/Misc/show-diag-options.c @@ -23,5 +23,5 @@ void test(int x, int y) { // OPTION_ERROR_CATEGORY: {{.*}}: error: {{[a-z ]+}} [-Werror,-Wparentheses,Semantic Issue] // Leverage the fact that all these '//'s get warned about in C89 pedantic. - // OPTION_PEDANTIC: {{.*}}: warning: {{[/a-z ]+}} [-pedantic,-Wcomment] + // OPTION_PEDANTIC: {{.*}}: warning: {{[/a-z ]+}} [-Wcomment] } diff --git a/test/Misc/tabstop.c b/test/Misc/tabstop.c index 49c4d7b..7f59b6a 100644 --- a/test/Misc/tabstop.c +++ b/test/Misc/tabstop.c @@ -35,13 +35,22 @@ void f(void) { if (0 & 1 == 1) {} + + if (1 == 0 & 1) + {} } // CHECK-3: {{^ }}if (0 & 1 == 1) // CHECK-3: {{^ }} ( ) +// CHECK-3: {{^ }}if (1 == 0 & 1) +// CHECK-3: {{^ }} ( ) // CHECK-4: {{^ }}if (0 & 1 == 1) // CHECK-4: {{^ }} ( ) +// CHECK-4: {{^ }}if (1 == 0 & 1) +// CHECK-4: {{^ }} ( ) // CHECK-5: {{^ }}if (0 & 1 == 1) // CHECK-5: {{^ }} ( ) +// CHECK-5: {{^ }}if (1 == 0 & 1) +// CHECK-5: {{^ }} ( ) diff --git a/test/Misc/warning-flags-enabled.c b/test/Misc/warning-flags-enabled.c new file mode 100644 index 0000000..7ef5c94 --- /dev/null +++ b/test/Misc/warning-flags-enabled.c @@ -0,0 +1,27 @@ +// RUN: diagtool show-enabled %s | FileCheck %s +// +// This shows warnings which are on by default. +// We just check a few to make sure it's doing something sensible. +// +// CHECK: ext_unterminated_string +// CHECK: warn_condition_is_assignment +// CHECK: warn_null_arg + + +// RUN: diagtool show-enabled -Wno-everything %s | count 0 + + +// RUN: diagtool show-enabled -Wno-everything -Wobjc-root-class %s | FileCheck -check-prefix CHECK-WARN %s +// RUN: diagtool show-enabled -Wno-everything -Werror=objc-root-class %s | FileCheck -check-prefix CHECK-ERROR %s +// RUN: diagtool show-enabled -Wno-everything -Wfatal-errors=objc-root-class %s | FileCheck -check-prefix CHECK-FATAL %s +// +// CHECK-WARN: W warn_objc_root_class_missing [-Wobjc-root-class] +// CHECK-ERROR: E warn_objc_root_class_missing [-Wobjc-root-class] +// CHECK-FATAL: F warn_objc_root_class_missing [-Wobjc-root-class] + +// RUN: diagtool show-enabled --no-levels -Wno-everything -Wobjc-root-class %s | FileCheck -check-prefix CHECK-NO-LEVELS %s +// +// CHECK-NO-LEVELS-NOT: W +// CHECK-NO-LEVELS-NOT: E +// CHECK-NO-LEVELS-NOT: F +// CHECK-NO-LEVELS: warn_objc_root_class_missing [-Wobjc-root-class] diff --git a/test/Misc/warning-flags-tree.c b/test/Misc/warning-flags-tree.c new file mode 100644 index 0000000..a64e942 --- /dev/null +++ b/test/Misc/warning-flags-tree.c @@ -0,0 +1,56 @@ +// RUN: diagtool tree | FileCheck -strict-whitespace %s +// RUN: diagtool tree -Weverything | FileCheck -strict-whitespace %s +// RUN: diagtool tree everything | FileCheck -strict-whitespace %s +// +// These three ways of running diagtool tree are the same: +// they produce a tree for every top-level diagnostic flag. +// Just check a few to make sure we're actually showing more than one group. +// +// CHECK: -W +// CHECK: -Wextra +// CHECK: -Wmissing-field-initializers +// CHECK: warn_missing_field_initializers +// CHECK: -Wall +// CHECK: -Wmost + +// These flags are currently unimplemented; test that we output them anyway. +// CHECK: -Wstrict-aliasing +// CHECK-NEXT: -Wstrict-aliasing=0 +// CHECK-NEXT: -Wstrict-aliasing=1 +// CHECK-NEXT: -Wstrict-aliasing=2 +// CHECK: -Wstrict-overflow +// CHECK-NEXT: -Wstrict-overflow=0 +// CHECK-NEXT: -Wstrict-overflow=1 +// CHECK-NEXT: -Wstrict-overflow=2 +// CHECK-NEXT: -Wstrict-overflow=3 +// CHECK-NEXT: -Wstrict-overflow=4 +// CHECK-NEXT: -Wstrict-overflow=5 + + +// RUN: not diagtool tree -Wthis-is-not-a-valid-flag + + +// RUN: diagtool tree -Wgnu | FileCheck -strict-whitespace -check-prefix CHECK-GNU %s +// CHECK-GNU: -Wgnu +// CHECK-GNU: -Wgnu-designator +// CHECK-GNU: ext_gnu_array_range +// CHECK-GNU: ext_gnu_missing_equal_designator +// CHECK-GNU: ext_gnu_old_style_field_designator +// CHECK-GNU: -Wvla +// CHECK-GNU: ext_vla +// CHECK-GNU: ext_array_init_copy +// CHECK-GNU: ext_empty_struct_union +// CHECK-GNU: ext_expr_not_ice +// There are more GNU extensions but we don't need to check them all. + +// RUN: diagtool tree --flags-only -Wgnu | FileCheck -check-prefix CHECK-FLAGS-ONLY %s +// CHECK-FLAGS-ONLY: -Wgnu +// CHECK-FLAGS-ONLY: -Wgnu-designator +// CHECK-FLAGS-ONLY-NOT: ext_gnu_array_range +// CHECK-FLAGS-ONLY-NOT: ext_gnu_missing_equal_designator +// CHECK-FLAGS-ONLY-NOT: ext_gnu_old_style_field_designator +// CHECK-FLAGS-ONLY: -Wvla +// CHECK-FLAGS-ONLY-NOT: ext_vla +// CHECK-FLAGS-ONLY-NOT: ext_array_init_copy +// CHECK-FLAGS-ONLY-NOT: ext_empty_struct_union +// CHECK-FLAGS-ONLY-NOT: ext_expr_not_ice diff --git a/test/Misc/warning-flags.c b/test/Misc/warning-flags.c index bc0c941..06c70eb 100644 --- a/test/Misc/warning-flags.c +++ b/test/Misc/warning-flags.c @@ -1,4 +1,5 @@ -RUN: diagtool list-warnings 2>&1 | FileCheck %s +RUN: diagtool list-warnings > %t 2>&1 +RUN: FileCheck --input-file=%t %s This test serves two purposes: @@ -17,73 +18,27 @@ This test serves two purposes: The list of warnings below should NEVER grow. It should gradually shrink to 0. -CHECK: Warnings without flags (253): -CHECK-NEXT: ext_anonymous_struct_union_qualified -CHECK-NEXT: ext_binary_literal -CHECK-NEXT: ext_cast_fn_obj +CHECK: Warnings without flags (159): CHECK-NEXT: ext_delete_void_ptr_operand -CHECK-NEXT: ext_designated_init -CHECK-NEXT: ext_duplicate_declspec -CHECK-NEXT: ext_ellipsis_exception_spec -CHECK-NEXT: ext_empty_fnmacro_arg -CHECK-NEXT: ext_empty_source_file CHECK-NEXT: ext_enum_friend -CHECK-NEXT: ext_enum_value_not_int -CHECK-NEXT: ext_enumerator_list_comma CHECK-NEXT: ext_expected_semi_decl_list -CHECK-NEXT: ext_explicit_instantiation_without_qualified_id CHECK-NEXT: ext_explicit_specialization_storage_class -CHECK-NEXT: ext_extra_ivar_semi -CHECK-NEXT: ext_extra_struct_semi -CHECK-NEXT: ext_forward_ref_enum -CHECK-NEXT: ext_freestanding_complex -CHECK-NEXT: ext_hexconstant_invalid -CHECK-NEXT: ext_ident_list_in_param -CHECK-NEXT: ext_imaginary_constant CHECK-NEXT: ext_implicit_lib_function_decl -CHECK-NEXT: ext_in_class_initializer_non_constant -CHECK-NEXT: ext_integer_complement_complex -CHECK-NEXT: ext_integer_complex -CHECK-NEXT: ext_integer_increment_complex -CHECK-NEXT: ext_invalid_sign_spec CHECK-NEXT: ext_missing_declspec -CHECK-NEXT: ext_missing_varargs_arg CHECK-NEXT: ext_missing_whitespace_after_macro_name CHECK-NEXT: ext_new_paren_array_nonconst -CHECK-NEXT: ext_nonstandard_escape -CHECK-NEXT: ext_param_not_declared -CHECK-NEXT: ext_paste_comma CHECK-NEXT: ext_plain_complex -CHECK-NEXT: ext_pp_bad_vaargs_use -CHECK-NEXT: ext_pp_comma_expr -CHECK-NEXT: ext_pp_ident_directive -CHECK-NEXT: ext_pp_include_next_directive -CHECK-NEXT: ext_pp_line_too_big CHECK-NEXT: ext_pp_macro_redef -CHECK-NEXT: ext_pp_warning_directive -CHECK-NEXT: ext_return_has_void_expr -CHECK-NEXT: ext_subscript_non_lvalue CHECK-NEXT: ext_template_arg_extra_parens -CHECK-NEXT: ext_thread_before -CHECK-NEXT: ext_top_level_semi -CHECK-NEXT: ext_typecheck_addrof_void -CHECK-NEXT: ext_typecheck_cast_nonscalar -CHECK-NEXT: ext_typecheck_cast_to_union CHECK-NEXT: ext_typecheck_comparison_of_distinct_pointers CHECK-NEXT: ext_typecheck_comparison_of_distinct_pointers_nonstandard -CHECK-NEXT: ext_typecheck_comparison_of_fptr_to_void CHECK-NEXT: ext_typecheck_comparison_of_pointer_integer CHECK-NEXT: ext_typecheck_cond_incompatible_operands CHECK-NEXT: ext_typecheck_cond_incompatible_operands_nonstandard -CHECK-NEXT: ext_typecheck_cond_one_void -CHECK-NEXT: ext_typecheck_convert_pointer_void_func CHECK-NEXT: ext_typecheck_ordered_comparison_of_function_pointers -CHECK-NEXT: ext_typecheck_ordered_comparison_of_pointer_and_zero CHECK-NEXT: ext_typecheck_ordered_comparison_of_pointer_integer -CHECK-NEXT: ext_typecheck_zero_array_size CHECK-NEXT: ext_unknown_escape CHECK-NEXT: ext_using_undefined_std -CHECK-NEXT: ext_vla_folded_to_constant CHECK-NEXT: pp_include_next_absolute_path CHECK-NEXT: pp_include_next_in_primary CHECK-NEXT: pp_invalid_string_literal @@ -96,26 +51,6 @@ CHECK-NEXT: w_asm_qualifier_ignored CHECK-NEXT: warn_accessor_property_type_mismatch CHECK-NEXT: warn_anon_bitfield_width_exceeds_type_size CHECK-NEXT: warn_asm_label_on_auto_decl -CHECK-NEXT: warn_attribute_ibaction -CHECK-NEXT: warn_attribute_iboutlet -CHECK-NEXT: warn_attribute_ignored -CHECK-NEXT: warn_attribute_ignored_for_field_of_type -CHECK-NEXT: warn_attribute_malloc_pointer_only -CHECK-NEXT: warn_attribute_nonnull_no_pointers -CHECK-NEXT: warn_attribute_precede_definition -CHECK-NEXT: warn_attribute_sentinel_named_arguments -CHECK-NEXT: warn_attribute_sentinel_not_variadic -CHECK-NEXT: warn_attribute_type_not_supported -CHECK-NEXT: warn_attribute_unknown_visibility -CHECK-NEXT: warn_attribute_void_function_method -CHECK-NEXT: warn_attribute_weak_import_invalid_on_definition -CHECK-NEXT: warn_attribute_weak_on_field -CHECK-NEXT: warn_attribute_weak_on_local -CHECK-NEXT: warn_attribute_wrong_decl_type -CHECK-NEXT: warn_availability_and_unavailable -CHECK-NEXT: warn_availability_unknown_platform -CHECK-NEXT: warn_availability_version_ordering -CHECK-NEXT: warn_bad_receiver_type CHECK-NEXT: warn_bitfield_width_exceeds_type_size CHECK-NEXT: warn_bool_switch_condition CHECK-NEXT: warn_braces_around_scalar_init @@ -124,7 +59,6 @@ CHECK-NEXT: warn_call_to_pure_virtual_member_function_from_ctor_dtor CHECK-NEXT: warn_call_wrong_number_of_arguments CHECK-NEXT: warn_case_empty_range CHECK-NEXT: warn_char_constant_too_large -CHECK-NEXT: warn_class_method_not_found CHECK-NEXT: warn_cmdline_missing_macro_defs CHECK-NEXT: warn_collection_expr_type CHECK-NEXT: warn_conflicting_param_types @@ -133,19 +67,15 @@ CHECK-NEXT: warn_conflicting_variadic CHECK-NEXT: warn_conv_to_base_not_used CHECK-NEXT: warn_conv_to_self_not_used CHECK-NEXT: warn_conv_to_void_not_used -CHECK-NEXT: warn_cxx0x_right_shift_in_template_arg CHECK-NEXT: warn_delete_array_type -CHECK-NEXT: warn_division_by_zero CHECK-NEXT: warn_double_const_requires_fp64 CHECK-NEXT: warn_drv_assuming_mfloat_abi_is CHECK-NEXT: warn_drv_clang_unsupported -CHECK-NEXT: warn_drv_input_file_unused CHECK-NEXT: warn_drv_not_using_clang_arch CHECK-NEXT: warn_drv_not_using_clang_cpp CHECK-NEXT: warn_drv_not_using_clang_cxx CHECK-NEXT: warn_drv_objc_gc_unsupported CHECK-NEXT: warn_drv_pch_not_first_include -CHECK-NEXT: warn_drv_preprocessed_input_file_unused CHECK-NEXT: warn_dup_category_def CHECK-NEXT: warn_duplicate_protocol_def CHECK-NEXT: warn_enum_too_large @@ -155,24 +85,17 @@ CHECK-NEXT: warn_exception_caught_by_earlier_handler CHECK-NEXT: warn_excess_initializers CHECK-NEXT: warn_excess_initializers_in_char_array_initializer CHECK-NEXT: warn_expected_qualified_after_typename -CHECK-NEXT: warn_extern_init CHECK-NEXT: warn_extraneous_char_constant CHECK-NEXT: warn_fe_cc_log_diagnostics_failure CHECK-NEXT: warn_fe_cc_print_header_failure CHECK-NEXT: warn_fe_macro_contains_embedded_newline CHECK-NEXT: warn_file_asm_volatile -CHECK-NEXT: warn_function_attribute_wrong_type -CHECK-NEXT: warn_gc_attribute_weak_on_local -CHECK-NEXT: warn_gnu_inline_attribute_requires_inline CHECK-NEXT: warn_hex_escape_too_large CHECK-NEXT: warn_ignoring_ftabstop_value -CHECK-NEXT: warn_illegal_constant_array_size CHECK-NEXT: warn_implements_nscopying CHECK-NEXT: warn_incompatible_qualified_id CHECK-NEXT: warn_initializer_string_for_char_array_too_long CHECK-NEXT: warn_inline_namespace_reopened_noninline -CHECK-NEXT: warn_inst_method_not_found -CHECK-NEXT: warn_instance_method_on_class_found CHECK-NEXT: warn_integer_too_large CHECK-NEXT: warn_integer_too_large_for_signed CHECK-NEXT: warn_invalid_asm_cast_lvalue @@ -189,19 +112,13 @@ CHECK-NEXT: warn_multiple_method_decl CHECK-NEXT: warn_no_constructor_for_refconst CHECK-NEXT: warn_nonnull_pointers_only CHECK-NEXT: warn_not_compound_assign -CHECK-NEXT: warn_ns_attribute_wrong_parameter_type -CHECK-NEXT: warn_ns_attribute_wrong_return_type -CHECK-NEXT: warn_objc_object_attribute_wrong_type CHECK-NEXT: warn_objc_property_copy_missing_on_block -CHECK-NEXT: warn_objc_property_default_assign_on_object -CHECK-NEXT: warn_objc_property_no_assignment_attribute CHECK-NEXT: warn_objc_protocol_qualifier_missing_id CHECK-NEXT: warn_octal_escape_too_large CHECK-NEXT: warn_odr_tag_type_inconsistent CHECK-NEXT: warn_on_superclass_use CHECK-NEXT: warn_param_default_argument_redefinition CHECK-NEXT: warn_partial_specs_not_deducible -CHECK-NEXT: warn_pointer_attribute_wrong_type CHECK-NEXT: warn_pp_convert_lhs_to_positive CHECK-NEXT: warn_pp_convert_rhs_to_positive CHECK-NEXT: warn_pp_expr_overflow @@ -238,14 +155,11 @@ CHECK-NEXT: warn_property_attribute CHECK-NEXT: warn_property_getter_owning_mismatch CHECK-NEXT: warn_property_types_are_incompatible CHECK-NEXT: warn_readonly_property -CHECK-NEXT: warn_receiver_forward_class CHECK-NEXT: warn_redecl_library_builtin CHECK-NEXT: warn_redeclaration_without_attribute_prev_attribute_ignored CHECK-NEXT: warn_register_objc_catch_parm CHECK-NEXT: warn_related_result_type_compatibility_class CHECK-NEXT: warn_related_result_type_compatibility_protocol -CHECK-NEXT: warn_remainder_by_zero -CHECK-NEXT: warn_root_inst_method_not_found CHECK-NEXT: warn_second_parameter_of_va_start_not_last_named_argument CHECK-NEXT: warn_second_parameter_to_va_arg_never_compatible CHECK-NEXT: warn_standalone_specifier @@ -254,20 +168,17 @@ CHECK-NEXT: warn_static_non_static CHECK-NEXT: warn_template_export_unsupported CHECK-NEXT: warn_template_spec_extra_headers CHECK-NEXT: warn_tentative_incomplete_array -CHECK-NEXT: warn_transparent_union_attribute_field_size_align -CHECK-NEXT: warn_transparent_union_attribute_floating -CHECK-NEXT: warn_transparent_union_attribute_not_definition -CHECK-NEXT: warn_transparent_union_attribute_zero_fields CHECK-NEXT: warn_typecheck_function_qualifiers CHECK-NEXT: warn_unavailable_fwdclass_message CHECK-NEXT: warn_undef_interface CHECK-NEXT: warn_undef_interface_suggest CHECK-NEXT: warn_undef_protocolref CHECK-NEXT: warn_undefined_internal -CHECK-NEXT: warn_unknown_analyzer_checker CHECK-NEXT: warn_unknown_method_family -CHECK-NEXT: warn_unterminated_char -CHECK-NEXT: warn_unterminated_string CHECK-NEXT: warn_use_out_of_scope_declaration CHECK-NEXT: warn_weak_identifier_undeclared CHECK-NEXT: warn_weak_import + +The list of warnings in -Wpedantic should NEVER grow. + +CHECK: Number in -Wpedantic (not covered by other -W flags): 39 diff --git a/test/Misc/wnull-character.cpp b/test/Misc/wnull-character.cpp Binary files differdeleted file mode 100644 index a618da2..0000000 --- a/test/Misc/wnull-character.cpp +++ /dev/null |