hokein updated this revision to Diff 263647.
hokein added a comment.
rebase to master
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D78350/new/
https://reviews.llvm.org/D78350
Files:
clang-tools-extra/clangd/unittests/CodeCompleteTests.cpp
clang/include/clang/Basic/LangOptions.def
clang/lib/Frontend/CompilerInvocation.cpp
clang/test/AST/ast-dump-openmp-begin-declare-variant_namespace_1.cpp
clang/test/CXX/class.access/p4.cpp
clang/test/CXX/special/class.ctor/p5-0x.cpp
clang/test/CXX/stmt.stmt/stmt.iter/stmt.ranged/p1.cpp
clang/test/OpenMP/target_update_from_messages.cpp
clang/test/OpenMP/target_update_to_messages.cpp
clang/test/Parser/objcxx0x-lambda-expressions.mm
clang/test/Parser/objcxx11-invalid-lambda.cpp
clang/test/SemaCXX/cast-conversion.cpp
clang/test/SemaCXX/constant-expression-cxx11.cpp
clang/test/SemaCXX/constructor-initializer.cpp
clang/test/SemaCXX/cxx0x-deleted-default-ctor.cpp
clang/test/SemaCXX/cxx1z-copy-omission.cpp
clang/test/SemaCXX/decltype-crash.cpp
clang/test/SemaCXX/enable_if.cpp
clang/test/SemaCXX/for-range-dereference.cpp
clang/test/SemaCXX/recovery-default-init.cpp
clang/test/SemaCXX/recovery-initializer.cpp
clang/test/SemaCXX/varargs.cpp
clang/test/SemaCXX/virtual-base-used.cpp
clang/test/SemaObjCXX/arc-0x.mm
clang/test/SemaOpenCLCXX/address-space-references.cl
clang/test/SemaTemplate/instantiate-function-params.cpp
clang/test/SemaTemplate/instantiate-init.cpp
Index: clang/test/SemaTemplate/instantiate-init.cpp
===================================================================
--- clang/test/SemaTemplate/instantiate-init.cpp
+++ clang/test/SemaTemplate/instantiate-init.cpp
@@ -108,7 +108,7 @@
integral_c<1> ic1 = array_lengthof(Description<int>::data);
(void)sizeof(array_lengthof(Description<float>::data));
- sizeof(array_lengthof( // expected-error{{no matching function for call to 'array_lengthof'}}
+ (void)sizeof(array_lengthof( // expected-error{{no matching function for call to 'array_lengthof'}}
Description<int*>::data // expected-note{{in instantiation of static data member 'PR7985::Description<int *>::data' requested here}}
));
Index: clang/test/SemaTemplate/instantiate-function-params.cpp
===================================================================
--- clang/test/SemaTemplate/instantiate-function-params.cpp
+++ clang/test/SemaTemplate/instantiate-function-params.cpp
@@ -3,32 +3,32 @@
// PR6619
template<bool C> struct if_c { };
template<typename T1> struct if_ {
- typedef if_c< static_cast<bool>(T1::value)> almost_type_; // expected-note 5{{in instantiation}}
+ typedef if_c< static_cast<bool>(T1::value)> almost_type_; // expected-note 7{{in instantiation}}
};
template <class Model, void (Model::*)()> struct wrap_constraints { };
template <class Model>
inline char has_constraints_(Model* , // expected-note 3{{candidate template ignored}}
- wrap_constraints<Model,&Model::constraints>* = 0); // expected-note 2{{in instantiation}}
+ wrap_constraints<Model,&Model::constraints>* = 0); // expected-note 4{{in instantiation}}
template <class Model> struct not_satisfied {
static const bool value = sizeof( has_constraints_((Model*)0) == 1); // expected-error 3{{no matching function}} \
- // expected-note 2{{while substituting deduced template arguments into function template 'has_constraints_' [with }}
+ // expected-note 4{{while substituting deduced template arguments into function template 'has_constraints_' [with }}
};
template <class ModelFn> struct requirement_;
template <void(*)()> struct instantiate {
};
-template <class Model> struct requirement_<void(*)(Model)> : if_< not_satisfied<Model> >::type { // expected-note 5{{in instantiation}}
+template <class Model> struct requirement_<void(*)(Model)> : if_< not_satisfied<Model> >::type { // expected-error 3{{no type named 'type' in}} expected-note 7{{in instantiation}}
};
template <class Model> struct usage_requirements {
};
template < typename TT > struct InputIterator {
- typedef instantiate< & requirement_<void(*)(usage_requirements<InputIterator> x)>::failed> boost_concept_check1; // expected-note {{in instantiation}}
+ typedef instantiate< & requirement_<void(*)(usage_requirements<InputIterator> x)>::failed> boost_concept_check1; // expected-note 2{{in instantiation}}
};
-template < typename TT > struct ForwardIterator : InputIterator<TT> { // expected-note {{in instantiation}}
- typedef instantiate< & requirement_<void(*)(usage_requirements<ForwardIterator> x)>::failed> boost_concept_check2; // expected-note {{in instantiation}}
+template < typename TT > struct ForwardIterator : InputIterator<TT> { // expected-note 2{{in instantiation}}
+ typedef instantiate< & requirement_<void(*)(usage_requirements<ForwardIterator> x)>::failed> boost_concept_check2; // expected-note 2{{in instantiation}}
};
-typedef instantiate< &requirement_<void(*)(ForwardIterator<char*> x)>::failed> boost_concept_checkX;// expected-note 3{{in instantiation}}
+typedef instantiate< &requirement_<void(*)(ForwardIterator<char*> x)>::failed> boost_concept_checkX;// expected-note 6{{in instantiation}}
template<typename T> struct X0 { };
template<typename R, typename A1> struct X0<R(A1 param)> { };
Index: clang/test/SemaOpenCLCXX/address-space-references.cl
===================================================================
--- clang/test/SemaOpenCLCXX/address-space-references.cl
+++ clang/test/SemaOpenCLCXX/address-space-references.cl
@@ -11,7 +11,7 @@
int bar(const unsigned int &i);
void foo() {
- bar(1) // expected-error{{binding reference of type 'const __global unsigned int' to value of type 'int' changes address space}}
+ bar(1); // expected-error{{binding reference of type 'const __global unsigned int' to value of type 'int' changes address space}}
}
// Test addr space conversion with nested pointers
Index: clang/test/SemaObjCXX/arc-0x.mm
===================================================================
--- clang/test/SemaObjCXX/arc-0x.mm
+++ clang/test/SemaObjCXX/arc-0x.mm
@@ -116,13 +116,13 @@
// Implicitly-declared special functions of a union are deleted by default if
// ARC is enabled and the union has an ObjC pointer field.
union U0 {
- id f0; // expected-note 7 {{'U0' is implicitly deleted because variant field 'f0' is an ObjC pointer}}
+ id f0; // expected-note 6 {{'U0' is implicitly deleted because variant field 'f0' is an ObjC pointer}}
};
union U1 {
- __weak id f0; // expected-note 13 {{'U1' is implicitly deleted because variant field 'f0' is an ObjC pointer}}
+ __weak id f0; // expected-note 12 {{'U1' is implicitly deleted because variant field 'f0' is an ObjC pointer}}
U1() = default; // expected-warning {{explicitly defaulted default constructor is implicitly deleted}} expected-note {{explicitly defaulted function was implicitly deleted here}}
- ~U1() = default; // expected-warning {{explicitly defaulted destructor is implicitly deleted}} expected-note 2{{explicitly defaulted function was implicitly deleted here}}
+ ~U1() = default; // expected-warning {{explicitly defaulted destructor is implicitly deleted}} expected-note {{explicitly defaulted function was implicitly deleted here}}
U1(const U1 &) = default; // expected-warning {{explicitly defaulted copy constructor is implicitly deleted}} expected-note 2 {{explicitly defaulted function was implicitly deleted here}}
U1(U1 &&) = default; // expected-warning {{explicitly defaulted move constructor is implicitly deleted}}
U1 & operator=(const U1 &) = default; // expected-warning {{explicitly defaulted copy assignment operator is implicitly deleted}} expected-note 2 {{explicitly defaulted function was implicitly deleted here}}
@@ -154,15 +154,15 @@
// functions of the containing class.
struct S0 {
union {
- id f0; // expected-note 7 {{'' is implicitly deleted because variant field 'f0' is an ObjC pointer}}
+ id f0; // expected-note 6 {{'' is implicitly deleted because variant field 'f0' is an ObjC pointer}}
char f1;
};
};
struct S1 {
union {
- union { // expected-note 2 {{'S1' is implicitly deleted because variant field '' has a non-trivial}} expected-note 5 {{'S1' is implicitly deleted because field '' has a deleted}}
- id f0; // expected-note 3 {{'' is implicitly deleted because variant field 'f0' is an ObjC pointer}}
+ union { // expected-note 2 {{'S1' is implicitly deleted because variant field '' has a non-trivial}} expected-note 4 {{'S1' is implicitly deleted because field '' has a deleted}}
+ id f0; // expected-note 2 {{'' is implicitly deleted because variant field 'f0' is an ObjC pointer}}
char f1;
};
int f2;
@@ -172,7 +172,7 @@
struct S2 {
union {
// FIXME: the note should say 'f0' is causing the special functions to be deleted.
- struct { // expected-note 7 {{'S2' is implicitly deleted because variant field '' has a non-trivial}}
+ struct { // expected-note 6 {{'S2' is implicitly deleted because variant field '' has a non-trivial}}
id f0;
int f1;
};
@@ -189,18 +189,14 @@
S1 *x5;
S2 *x6;
- static union { // expected-error {{call to implicitly-deleted default constructor of}} expected-error {{attempt to use a deleted function}}
- id g0; // expected-note {{default constructor of '' is implicitly deleted because variant field 'g0' is an ObjC pointer}} \
- // expected-note {{destructor of '' is implicitly deleted because}}
+ static union { // expected-error {{call to implicitly-deleted default constructor of}}
+ id g0; // expected-note {{default constructor of '' is implicitly deleted because variant field 'g0' is an ObjC pointer}}
};
- static union { // expected-error {{call to implicitly-deleted default constructor of}} expected-error {{attempt to use a deleted function}}
- union { // expected-note {{default constructor of '' is implicitly deleted because field '' has a deleted default constructor}} \
- // expected-note {{destructor of '' is implicitly deleted because}}
- union { // expected-note {{default constructor of '' is implicitly deleted because field '' has a deleted default constructor}} \
- // expected-note {{destructor of '' is implicitly deleted because}}
- __weak id g1; // expected-note {{default constructor of '' is implicitly deleted because variant field 'g1' is an ObjC pointer}} \
- // expected-note {{destructor of '' is implicitly deleted because}}
+ static union { // expected-error {{call to implicitly-deleted default constructor of}}
+ union { // expected-note {{default constructor of '' is implicitly deleted because field '' has a deleted default constructor}}
+ union { // expected-note {{default constructor of '' is implicitly deleted because field '' has a deleted default constructor}}
+ __weak id g1; // expected-note {{default constructor of '' is implicitly deleted because variant field 'g1' is an ObjC pointer}}
int g2;
};
int g3;
@@ -209,13 +205,13 @@
};
void testDefaultConstructor() {
- U0 t0; // expected-error {{call to implicitly-deleted default constructor}} expected-error {{attempt to use a deleted function}}
- U1 t1; // expected-error {{call to implicitly-deleted default constructor}} expected-error {{attempt to use a deleted function}}
+ U0 t0; // expected-error {{call to implicitly-deleted default constructor}}
+ U1 t1; // expected-error {{call to implicitly-deleted default constructor}}
U2 t2;
U3 t3;
- S0 t4; // expected-error {{call to implicitly-deleted default constructor}} expected-error {{attempt to use a deleted function}}
- S1 t5; // expected-error {{call to implicitly-deleted default constructor}} expected-error {{attempt to use a deleted function}}
- S2 t6; // expected-error {{call to implicitly-deleted default constructor}} expected-error {{attempt to use a deleted function}}
+ S0 t4; // expected-error {{call to implicitly-deleted default constructor}}
+ S1 t5; // expected-error {{call to implicitly-deleted default constructor}}
+ S2 t6; // expected-error {{call to implicitly-deleted default constructor}}
}
void testDestructor(U0 *u0, U1 *u1, U2 *u2, U3 *u3, S0 *s0, S1 *s1, S2 *s2) {
Index: clang/test/SemaCXX/virtual-base-used.cpp
===================================================================
--- clang/test/SemaCXX/virtual-base-used.cpp
+++ clang/test/SemaCXX/virtual-base-used.cpp
@@ -40,7 +40,6 @@
// expected-note@-7 {{destructor of 'B' is implicitly deleted because field 'x' has an inaccessible destructor}}
#ifdef MSABI
// expected-note@-9 {{default constructor of 'B' is implicitly deleted because field 'x' has an inaccessible destructor}}
- // expected-note@-10 {{destructor of 'B' is implicitly deleted}}
#endif
#endif
};
@@ -60,10 +59,6 @@
~D();
#if __cplusplus >= 201103L
//expected-error@-2 {{non-deleted function '~D' cannot override a deleted function}}
-#ifdef MSABI
-//expected-error@-4 {{use a deleted function}}
-#else
-#endif
#endif
};
@@ -72,8 +67,7 @@
#if __cplusplus <= 199711L
// expected-note@-2 2{{implicit default constructor for 'D' first required here}}
#else
-// expected-error@-4 {{call to implicitly-deleted default constructor of 'D'}}
-// expected-note@-5 {{implicit destructor for 'D' first required here}}
+// expected-error@-4 {{call to implicitly-deleted default constructor of 'D'}}å
#endif
#else
void D::foo() {
@@ -98,7 +92,6 @@
// expected-note@-7 {{destructor of 'E' is implicitly deleted because field 'x' has an inaccessible destructor}}
#ifdef MSABI
// expected-note@-9 {{default constructor of 'E' is implicitly deleted because field 'x' has an inaccessible destructor}}
- // expected-note@-10 {{destructor of 'E' is implicitly deleted}}
#endif
#endif
};
@@ -113,7 +106,6 @@
// expected-note@-7 {{overridden virtual function is here}}
#ifdef MSABI
// expected-note@-9 {{default constructor of 'F' is implicitly deleted because base class 'E' has a deleted default constructor}}
-// expected-note@-10 {{destructor of 'F' is implicitly deleted}}
#endif
#endif
};
@@ -133,9 +125,6 @@
~G();
#if __cplusplus >= 201103L
//expected-error@-2 {{non-deleted function '~G' cannot override a deleted function}}
-#ifdef MSABI
- //expected-error@-4 {{use a deleted function}}
-#endif
#endif
};
@@ -145,7 +134,6 @@
// expected-note@-2 2{{implicit default constructor for 'G' first required here}}
#else
// expected-error@-4 {{call to implicitly-deleted default constructor of 'G'}}
-// expected-note@-5 {{mplicit destructor for 'G' first required here}}
#endif
#else
void G::foo() {
@@ -171,7 +159,6 @@
// expected-note@-7 {{destructor of 'H' is implicitly deleted because field 'x' has an inaccessible destructor}}
#ifdef MSABI
// expected-note@-9 {{default constructor of 'H' is implicitly deleted because field 'x' has an inaccessible destructor}}
- // expected-note@-10 {{destructor of 'H' is implicitly deleted}}
#endif
#endif
};
@@ -201,11 +188,6 @@
virtual void foo();
~J();
-#ifdef MSABI
-#if __cplusplus >= 201103L
-//expected-error@-3 {{use a deleted function}}
-#endif
-#endif
};
#ifdef MSABI
@@ -214,7 +196,6 @@
// expected-note@-2 2{{implicit default constructor for 'J' first required here}}
#else
// expected-error@-4 {{call to implicitly-deleted default constructor of 'J'}}
-// expected-note@-5 {{implicit destructor for 'J' first required here}}
#endif
#else
Index: clang/test/SemaCXX/varargs.cpp
===================================================================
--- clang/test/SemaCXX/varargs.cpp
+++ clang/test/SemaCXX/varargs.cpp
@@ -22,7 +22,8 @@
// default ctor.
void record_context(int a, ...) {
struct Foo {
- // expected-error@+1 {{'va_start' cannot be used outside a function}}
+ // expected-error@+2 {{'va_start' cannot be used outside a function}}
+ // expected-error@+1 {{default argument references parameter 'a'}}
void meth(int a, int b = (__builtin_va_start(ap, a), 0)) {}
};
}
Index: clang/test/SemaCXX/recovery-initializer.cpp
===================================================================
--- clang/test/SemaCXX/recovery-initializer.cpp
+++ /dev/null
@@ -1,29 +0,0 @@
-// RUN: %clang_cc1 -std=c++11 -fsyntax-only -frecovery-ast -verify %s
-
-// NOTE: these tests can be merged to existing tests after -frecovery-ast is
-// turned on by default.
-void test1() {
- struct Data {};
- struct T {
- Data *begin();
- Data *end();
- };
- T *pt;
- for (Data *p : T()) {} // expected-error {{no viable conversion from 'Data' to 'Data *'}}
- // expected-note@-5 {{selected 'begin' function with iterator type}}
-}
-
-void test2() {
- struct Bottom {
- constexpr Bottom() {}
- };
- struct Base : Bottom {
- constexpr Base(int a = 42, const char *b = "test") : a(a), b(b) {}
- int a;
- const char *b;
- };
- constexpr Base *nullB = 12; // expected-error {{cannot initialize a variable of type}}
- // verify that the "static_assert expression is not an integral constant expr"
- // diagnostic is suppressed.
- static_assert((Bottom*)nullB == 0, "");
-}
Index: clang/test/SemaCXX/recovery-default-init.cpp
===================================================================
--- clang/test/SemaCXX/recovery-default-init.cpp
+++ /dev/null
@@ -1,14 +0,0 @@
-// RUN: %clang_cc1 %s -fsyntax-only -frecovery-ast -verify -std=c++11
-
-// NOTE: the test can be merged into existing tests once -frecovery-ast is on
-// by default.
-
-struct Foo { // expected-note {{candidate constructor (the implicit copy constructor) not viable}}
- Foo(int); // expected-note {{candidate constructor not viable}}
- ~Foo() = delete;
-};
-
-void test() {
- // we expect the "attempt to use a deleted function" diagnostic is suppressed.
- Foo foo; // expected-error {{no matching constructor for initialization of}}
-}
Index: clang/test/SemaCXX/for-range-dereference.cpp
===================================================================
--- clang/test/SemaCXX/for-range-dereference.cpp
+++ clang/test/SemaCXX/for-range-dereference.cpp
@@ -85,4 +85,5 @@
for (Data *p : pt) { } // expected-error {{invalid range expression of type 'T *'; did you mean to dereference it with '*'?}}
// expected-error@-1 {{no viable conversion from 'Data' to 'Data *'}}
+ // expected-note@4 {{selected 'begin' function with iterator type 'Data *'}}
}
Index: clang/test/SemaCXX/enable_if.cpp
===================================================================
--- clang/test/SemaCXX/enable_if.cpp
+++ clang/test/SemaCXX/enable_if.cpp
@@ -414,8 +414,8 @@
template <int N> constexpr int callTemplated() { return templated<N>(); }
-constexpr int B = 10 + // the carat for the error should be pointing to the problematic call (on the next line), not here.
- callTemplated<0>(); // expected-error{{initialized by a constant expression}} expected-error@-3{{no matching function for call to 'templated'}} expected-note{{in instantiation of function template}} expected-note@-10{{candidate disabled}}
+constexpr int B = 10 + // expected-error {{initialized by a constant expression}}
+ callTemplated<0>(); // expected-error@-3{{no matching function for call to 'templated'}} expected-note{{in instantiation of function template}} expected-note@-10{{candidate disabled}} expected-note {{in call to 'callTemplated()'}} expected-note@-3 {{subexpression not valid in a constant expression}}
static_assert(callTemplated<1>() == 1, "");
}
Index: clang/test/SemaCXX/decltype-crash.cpp
===================================================================
--- clang/test/SemaCXX/decltype-crash.cpp
+++ clang/test/SemaCXX/decltype-crash.cpp
@@ -3,5 +3,8 @@
int& a();
void f() {
- decltype(a()) c; // expected-warning {{'decltype' is a keyword in C++11}} expected-error {{use of undeclared identifier 'decltype'}}
+ decltype(a()) c; // expected-warning {{'decltype' is a keyword in C++11}} \
+ // expected-error {{use of undeclared identifier 'decltype'}} \
+ // expected-error {{expected ';' after expression}} \
+ // expected-error {{use of undeclared identifier 'c'}}
}
Index: clang/test/SemaCXX/cxx1z-copy-omission.cpp
===================================================================
--- clang/test/SemaCXX/cxx1z-copy-omission.cpp
+++ clang/test/SemaCXX/cxx1z-copy-omission.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -std=c++1z -verify %s
+// RUN: %clang_cc1 -std=c++1z -verify -Wno-unused %s
struct Noncopyable {
Noncopyable();
@@ -107,8 +107,10 @@
sizeof(make_indestructible()); // expected-error {{deleted}}
sizeof(make_incomplete()); // expected-error {{incomplete}}
typeid(Indestructible{}); // expected-error {{deleted}}
- typeid(make_indestructible()); // expected-error {{deleted}}
- typeid(make_incomplete()); // expected-error {{incomplete}}
+ typeid(make_indestructible()); // expected-error {{deleted}} \
+ // expected-error {{need to include <typeinfo>}}
+ typeid(make_incomplete()); // expected-error {{incomplete}} \
+ // expected-error {{need to include <typeinfo>}}
// FIXME: The first two cases here are now also valid in C++17 onwards.
using I = decltype(Indestructible()); // expected-error {{deleted}}
Index: clang/test/SemaCXX/cxx0x-deleted-default-ctor.cpp
===================================================================
--- clang/test/SemaCXX/cxx0x-deleted-default-ctor.cpp
+++ clang/test/SemaCXX/cxx0x-deleted-default-ctor.cpp
@@ -8,9 +8,9 @@
};
union bad_union {
- non_trivial nt; // expected-note {{non-trivial default constructor}} expected-note {{destructor of 'bad_union' is implicitly deleted}}
+ non_trivial nt; // expected-note {{non-trivial default constructor}}
};
-bad_union u; // expected-error {{call to implicitly-deleted default constructor}} expected-error {{attempt to use a deleted function}}
+bad_union u; // expected-error {{call to implicitly-deleted default constructor}}
union bad_union2 { // expected-note {{all data members are const-qualified}}
const int i;
};
@@ -18,10 +18,10 @@
struct bad_anon {
union {
- non_trivial nt; // expected-note {{non-trivial default constructor}} expected-note {{destructor of 'bad_anon' is implicitly deleted}}
+ non_trivial nt; // expected-note {{non-trivial default constructor}}
};
};
-bad_anon a; // expected-error {{call to implicitly-deleted default constructor}} expected-error {{attempt to use a deleted function}}
+bad_anon a; // expected-error {{call to implicitly-deleted default constructor}}
struct bad_anon2 {
union { // expected-note {{all data members of an anonymous union member are const-qualified}}
const int i;
@@ -62,7 +62,7 @@
no_default() = delete; // expected-note 5{{deleted here}}
};
struct no_dtor {
- ~no_dtor() = delete; // expected-note 4{{deleted here}}
+ ~no_dtor() = delete; // expected-note 2{{deleted here}}
};
struct bad_field_default {
@@ -74,12 +74,12 @@
bad_base_default bbd; // expected-error {{call to implicitly-deleted default constructor}}
struct bad_field_dtor {
- no_dtor nd; // expected-note {{field 'nd' has a deleted destructor}} expected-note {{destructor of 'bad_field_dtor' is implicitly deleted }}
+ no_dtor nd; // expected-note {{field 'nd' has a deleted destructor}}
};
-bad_field_dtor bfx; // expected-error {{call to implicitly-deleted default constructor}} expected-error {{attempt to use a deleted function}}
-struct bad_base_dtor : no_dtor { // expected-note {{base class 'no_dtor' has a deleted destructor}} expected-note {{destructor of 'bad_base_dtor' is implicitly deleted}}
+bad_field_dtor bfx; // expected-error {{call to implicitly-deleted default constructor}}
+struct bad_base_dtor : no_dtor { // expected-note {{base class 'no_dtor' has a deleted destructor}}
};
-bad_base_dtor bbx; // expected-error {{call to implicitly-deleted default constructor}} expected-error {{attempt to use a deleted function}}
+bad_base_dtor bbx; // expected-error {{call to implicitly-deleted default constructor}}
struct ambiguous_default {
ambiguous_default();
Index: clang/test/SemaCXX/constructor-initializer.cpp
===================================================================
--- clang/test/SemaCXX/constructor-initializer.cpp
+++ clang/test/SemaCXX/constructor-initializer.cpp
@@ -250,7 +250,7 @@
B(const String& s, int e=0) // expected-error {{unknown type name}}
: A(e), m_String(s) , m_ErrorStr(__null) {} // expected-error {{no matching constructor}} expected-error {{does not name}}
B(const B& e)
- : A(e), m_String(e.m_String), m_ErrorStr(__null) { // expected-error {{does not name}} \
+ : A(e), m_String(e.m_String), m_ErrorStr(__null) { // expected-error 2{{does not name}} \
// expected-error {{no member named 'm_String' in 'test3::B'}}
}
};
Index: clang/test/SemaCXX/constant-expression-cxx11.cpp
===================================================================
--- clang/test/SemaCXX/constant-expression-cxx11.cpp
+++ clang/test/SemaCXX/constant-expression-cxx11.cpp
@@ -877,7 +877,7 @@
// null pointer in C++11. Just check for an integer literal with value 0.
constexpr Base *nullB = 42 - 6 * 7; // expected-error {{cannot initialize a variable of type 'Class::Base *const' with an rvalue of type 'int'}}
constexpr Base *nullB1 = 0;
-static_assert((Bottom*)nullB == 0, ""); // expected-error {{static_assert expression is not an integral constant expression}}
+static_assert((Bottom*)nullB == 0, "");
static_assert((Derived*)nullB1 == 0, "");
static_assert((void*)(Bottom*)nullB1 == (void*)(Derived*)nullB1, "");
Base *nullB2 = '\0'; // expected-error {{cannot initialize a variable of type 'Class::Base *' with an rvalue of type 'char'}}
Index: clang/test/SemaCXX/cast-conversion.cpp
===================================================================
--- clang/test/SemaCXX/cast-conversion.cpp
+++ clang/test/SemaCXX/cast-conversion.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -fsyntax-only -triple x86_64-unknown-unknown -verify %s -std=c++11
+// RUN: %clang_cc1 -fsyntax-only -triple x86_64-unknown-unknown -verify %s -std=c++11 -Wno-unused
struct R {
R(int);
Index: clang/test/Parser/objcxx11-invalid-lambda.cpp
===================================================================
--- clang/test/Parser/objcxx11-invalid-lambda.cpp
+++ clang/test/Parser/objcxx11-invalid-lambda.cpp
@@ -1,10 +1,11 @@
// RUN: %clang_cc1 -fsyntax-only -verify -x objective-c++ -std=c++11 %s
-void foo() { // expected-note {{to match this '{'}}
+void foo() {
int bar;
auto baz = [
- bar( // expected-note {{to match this '('}} expected-note {{to match this '('}}
+ bar( // expected-note 2{{to match this '('}}\
+ // expected-warning {{captures are a C++14 extension}}
foo_undeclared() // expected-error{{use of undeclared identifier 'foo_undeclared'}}
/* ) */
- ] () { }; // expected-error{{expected ')'}}
-} // expected-error{{expected ')'}} expected-error {{expected ',' or ']'}} expected-error{{expected ';' at end of declaration}} expected-error{{expected '}'}}
+ ] () { }; // expected-error 2{{expected ')'}}
+}
\ No newline at end of file
Index: clang/test/Parser/objcxx0x-lambda-expressions.mm
===================================================================
--- clang/test/Parser/objcxx0x-lambda-expressions.mm
+++ clang/test/Parser/objcxx0x-lambda-expressions.mm
@@ -11,7 +11,8 @@
[]; // expected-error {{expected body of lambda expression}}
[=,foo+] {}; // expected-error {{expected ',' or ']' in lambda capture list}}
- [&this] {}; // expected-error {{cannot take the address of an rvalue of type 'C *'}}
+ [&this] {}; // expected-error {{cannot take the address of an rvalue of type 'C *'}} \
+ // expected-error {{expected identifier}}
[] {};
[=] (int i) {};
[&] (int) mutable -> void {};
@@ -24,7 +25,8 @@
[foo{bar}] () {};
[foo = {bar}] () {}; // expected-error {{<initializer_list>}}
- [foo(bar) baz] () {}; // expected-error {{called object type 'int' is not a function}}
+ [foo(bar) baz] () {}; // expected-error {{called object type 'int' is not a function}} \
+ // expected-error {{expected ';'}}
[foo(bar), baz] () {}; // ok
[foo = bar baz]; // expected-warning {{receiver type 'int'}} expected-warning {{instance method '-baz'}}
Index: clang/test/OpenMP/target_update_to_messages.cpp
===================================================================
--- clang/test/OpenMP/target_update_to_messages.cpp
+++ clang/test/OpenMP/target_update_to_messages.cpp
@@ -77,7 +77,7 @@
#pragma omp target update to(*(this->S->i+this->S->s6[0].pp)) // le45-error {{expected expression containing only member accesses and/or array sections based on named variables}} le45-error {{expected at least one 'to' clause or 'from' clause specified to '#pragma omp target update'}}
#pragma omp target update to(*(a+this->ptr)) // le45-error {{expected expression containing only member accesses and/or array sections based on named variables}} le45-error {{expected at least one 'to' clause or 'from' clause specified to '#pragma omp target update'}}
#pragma omp target update to(*(*(this->ptr)+a+this->ptr)) // le45-error {{expected expression containing only member accesses and/or array sections based on named variables}} le45-error {{expected at least one 'to' clause or 'from' clause specified to '#pragma omp target update'}}
-#pragma omp target update to(*(this+this)) // expected-error {{expected at least one 'to' clause or 'from' clause specified to '#pragma omp target update'}} expected-error {{invalid operands to binary expression ('S8 *' and 'S8 *')}}
+#pragma omp target update to(*(this+this)) // expected-error {{invalid operands to binary expression ('S8 *' and 'S8 *')}}
{}
}
};
@@ -205,8 +205,8 @@
#pragma omp target update to(**(*offset+BB+*m)) // le45-error {{expected expression containing only member accesses and/or array sections based on named variables}} le45-error {{expected at least one 'to' clause or 'from' clause specified to '#pragma omp target update'}}
#pragma omp target update to(**(*(*(&offset))+BB+*m)) // le45-error {{expected expression containing only member accesses and/or array sections based on named variables}} le45-error {{expected at least one 'to' clause or 'from' clause specified to '#pragma omp target update'}}
#pragma omp target update to(*(x+*(y+*(**BB+BBB)+s7.i))) // le45-error {{expected expression containing only member accesses and/or array sections based on named variables}} le45-error {{expected at least one 'to' clause or 'from' clause specified to '#pragma omp target update'}}
-#pragma omp target update to(*(m+(m))) // expected-error {{invalid operands to binary expression ('int *' and 'int *')}} expected-error {{expected at least one 'to' clause or 'from' clause specified to '#pragma omp target update'}}
-#pragma omp target update to(*(1+y+y)) // expected-error {{indirection requires pointer operand ('int' invalid)}} expected-error {{expected at least one 'to' clause or 'from' clause specified to '#pragma omp target update'}}
+#pragma omp target update to(*(m+(m))) // expected-error {{invalid operands to binary expression ('int *' and 'int *')}}
+#pragma omp target update to(*(1+y+y)) // expected-error {{indirection requires pointer operand ('int' invalid)}}
{}
return tmain<int, 3>(argc)+tmain<from, 4>(argc); // expected-note {{in instantiation of function template specialization 'tmain<int, 3>' requested here}} expected-note {{in instantiation of function template specialization 'tmain<int, 4>' requested here}}
}
Index: clang/test/OpenMP/target_update_from_messages.cpp
===================================================================
--- clang/test/OpenMP/target_update_from_messages.cpp
+++ clang/test/OpenMP/target_update_from_messages.cpp
@@ -74,7 +74,7 @@
#pragma omp target update from(*(this->S->i+this->S->s6[0].pp)) // le45-error {{expected expression containing only member accesses and/or array sections based on named variables}} le45-error {{expected at least one 'to' clause or 'from' clause specified to '#pragma omp target update'}}
#pragma omp target update from(*(a+this->ptr)) // le45-error {{expected expression containing only member accesses and/or array sections based on named variables}} le45-error {{expected at least one 'to' clause or 'from' clause specified to '#pragma omp target update'}}
#pragma omp target update from(*(*(this->ptr)+a+this->ptr)) // le45-error {{expected expression containing only member accesses and/or array sections based on named variables}} le45-error {{expected at least one 'to' clause or 'from' clause specified to '#pragma omp target update'}}
-#pragma omp target update from(*(this+this)) // expected-error {{expected at least one 'to' clause or 'from' clause specified to '#pragma omp target update'}} expected-error {{invalid operands to binary expression ('S8 *' and 'S8 *')}}
+#pragma omp target update from(*(this+this)) // expected-error {{invalid operands to binary expression ('S8 *' and 'S8 *')}}
}
};
@@ -198,8 +198,8 @@
#pragma omp target update from(**(-(*offset)+BB+*m)) // le45-error {{expected expression containing only member accesses and/or array sections based on named variables}} le45-error {{expected at least one 'to' clause or 'from' clause specified to '#pragma omp target update'}}
#pragma omp target update from(**(*(*(&offset))+BB-*m)) // le45-error {{expected expression containing only member accesses and/or array sections based on named variables}} le45-error {{expected at least one 'to' clause or 'from' clause specified to '#pragma omp target update'}}
#pragma omp target update from(*(x+*(y+*(**BB+BBB)+s7.i))) // le45-error {{expected expression containing only member accesses and/or array sections based on named variables}} le45-error {{expected at least one 'to' clause or 'from' clause specified to '#pragma omp target update'}}
-#pragma omp target update from(*(m+(m))) // expected-error {{invalid operands to binary expression ('int *' and 'int *')}} expected-error {{expected at least one 'to' clause or 'from' clause specified to '#pragma omp target update'}}
-#pragma omp target update from(*(1+y+y)) // expected-error {{indirection requires pointer operand ('int' invalid)}} expected-error {{expected at least one 'to' clause or 'from' clause specified to '#pragma omp target update'}}
+#pragma omp target update from(*(m+(m))) // expected-error {{invalid operands to binary expression ('int *' and 'int *')}}
+#pragma omp target update from(*(1+y+y)) // expected-error {{indirection requires pointer operand ('int' invalid)}}
#pragma omp target data map(to: s7.i)
{
#pragma omp target update from(s7.x)
Index: clang/test/CXX/stmt.stmt/stmt.iter/stmt.ranged/p1.cpp
===================================================================
--- clang/test/CXX/stmt.stmt/stmt.iter/stmt.ranged/p1.cpp
+++ clang/test/CXX/stmt.stmt/stmt.iter/stmt.ranged/p1.cpp
@@ -21,7 +21,8 @@
auto end(T &&t) -> decltype(t.end()) { return t.end(); } // expected-note {{candidate template ignored: substitution failure [with T = }}
template<typename T>
- auto begin(T &&t) -> decltype(t.alt_begin()) { return t.alt_begin(); } // expected-note 2{{candidate template ignored: substitution failure [with T = }}
+ auto begin(T &&t) -> decltype(t.alt_begin()) { return t.alt_begin(); } // expected-note {{selected 'begin' template [with T = }} \
+ // expected-note 2{{candidate template ignored: substitution failure [with T = }}
template<typename T>
auto end(T &&t) -> decltype(t.alt_end()) { return t.alt_end(); } // expected-note {{candidate template ignored: substitution failure [with T = }}
@@ -35,7 +36,7 @@
struct A { // expected-note 2 {{candidate constructor}}
A();
- int *begin(); // expected-note {{selected 'begin' function with iterator type 'int *'}} expected-note {{'begin' declared here}}
+ int *begin(); // expected-note 3{{selected 'begin' function with iterator type 'int *'}} expected-note {{'begin' declared here}}
int *end();
};
Index: clang/test/CXX/special/class.ctor/p5-0x.cpp
===================================================================
--- clang/test/CXX/special/class.ctor/p5-0x.cpp
+++ clang/test/CXX/special/class.ctor/p5-0x.cpp
@@ -4,7 +4,7 @@
struct DefaultedDefCtor2 { DefaultedDefCtor2() = default; };
struct DeletedDefCtor { DeletedDefCtor() = delete; DeletedDefCtor(int); }; // expected-note {{explicitly marked deleted here}}
class PrivateDefCtor { PrivateDefCtor() = default; public: PrivateDefCtor(int); };
-struct DeletedDtor { ~DeletedDtor() = delete; }; // expected-note 8{{explicitly marked deleted here}}
+struct DeletedDtor { ~DeletedDtor() = delete; }; // expected-note 4{{explicitly marked deleted here}}
class PrivateDtor { ~PrivateDtor() = default; };
class Friend {
Friend() = default; ~Friend() = default;
@@ -122,22 +122,22 @@
// - any direct or virtual base class or non-static data member has a type with
// a destructor that is deleted or inaccessible from the defaulted default
// constructor.
-struct Deleted7a : DeletedDtor {}; // expected-note 2{{because base class 'DeletedDtor' has a deleted destructor}}
-Deleted7a d7a; // expected-error {{implicitly-deleted default constructor}} expected-error {{attempt to use a deleted function}}
-struct Deleted7b : virtual DeletedDtor {}; // expected-note 2{{because base class 'DeletedDtor' has a deleted destructor}}
-Deleted7b d7b; // expected-error {{implicitly-deleted default constructor}} expected-error {{attempt to use a deleted function}}
-struct Deleted7c { DeletedDtor a; }; // expected-note 2{{because field 'a' has a deleted destructor}}
-Deleted7c d7c; // expected-error {{implicitly-deleted default constructor}} expected-error {{attempt to use a deleted function}}
-struct Deleted7d { DeletedDtor a = {}; }; // expected-note 2{{because field 'a' has a deleted destructor}}
-Deleted7d d7d; // expected-error {{implicitly-deleted default constructor}} expected-error {{attempt to use a deleted function}}
-struct Deleted7e : PrivateDtor {}; // expected-note 2{{base class 'PrivateDtor' has an inaccessible destructor}}
-Deleted7e d7e; // expected-error {{implicitly-deleted default constructor}} expected-error {{attempt to use a deleted function}}
-struct Deleted7f : virtual PrivateDtor {}; // expected-note 2{{base class 'PrivateDtor' has an inaccessible destructor}}
-Deleted7f d7f; // expected-error {{implicitly-deleted default constructor}} expected-error {{attempt to use a deleted function}}
-struct Deleted7g { PrivateDtor a; }; // expected-note 2{{field 'a' has an inaccessible destructor}}
-Deleted7g d7g; // expected-error {{implicitly-deleted default constructor}} expected-error {{attempt to use a deleted function}}
-struct Deleted7h { PrivateDtor a = {}; }; // expected-note 2{{field 'a' has an inaccessible destructor}}
-Deleted7h d7h; // expected-error {{implicitly-deleted default constructor}} expected-error {{attempt to use a deleted function}}
+struct Deleted7a : DeletedDtor {}; // expected-note {{because base class 'DeletedDtor' has a deleted destructor}}
+Deleted7a d7a; // expected-error {{implicitly-deleted default constructor}}
+struct Deleted7b : virtual DeletedDtor {}; // expected-note {{because base class 'DeletedDtor' has a deleted destructor}}
+Deleted7b d7b; // expected-error {{implicitly-deleted default constructor}}
+struct Deleted7c { DeletedDtor a; }; // expected-note {{because field 'a' has a deleted destructor}}
+Deleted7c d7c; // expected-error {{implicitly-deleted default constructor}}
+struct Deleted7d { DeletedDtor a = {}; }; // expected-note {{because field 'a' has a deleted destructor}}
+Deleted7d d7d; // expected-error {{implicitly-deleted default constructor}}
+struct Deleted7e : PrivateDtor {}; // expected-note {{base class 'PrivateDtor' has an inaccessible destructor}}
+Deleted7e d7e; // expected-error {{implicitly-deleted default constructor}}
+struct Deleted7f : virtual PrivateDtor {}; // expected-note {{base class 'PrivateDtor' has an inaccessible destructor}}
+Deleted7f d7f; // expected-error {{implicitly-deleted default constructor}}
+struct Deleted7g { PrivateDtor a; }; // expected-note {{field 'a' has an inaccessible destructor}}
+Deleted7g d7g; // expected-error {{implicitly-deleted default constructor}}
+struct Deleted7h { PrivateDtor a = {}; }; // expected-note {{field 'a' has an inaccessible destructor}}
+Deleted7h d7h; // expected-error {{implicitly-deleted default constructor}}
struct NotDeleted7i : Friend {};
NotDeleted7i d7i;
struct NotDeleted7j : virtual Friend {};
Index: clang/test/CXX/class.access/p4.cpp
===================================================================
--- clang/test/CXX/class.access/p4.cpp
+++ clang/test/CXX/class.access/p4.cpp
@@ -220,14 +220,14 @@
};
class Derived3 :
- Base<0>, // expected-note 2{{deleted because base class 'Base<0>' has an inaccessible destructor}}
+ Base<0>, // expected-note {{deleted because base class 'Base<0>' has an inaccessible destructor}}
virtual Base<1>,
Base2,
virtual Base3
{};
- Derived3 d3; // expected-error {{implicitly-deleted default constructor}} expected-error {{attempt to use a deleted function}}
+ Derived3 d3; // expected-error {{implicitly-deleted default constructor}}
#elif __cplusplus >= 201103L && defined(_MSC_VER)
- template <unsigned N> class Base { ~Base(); }; // expected-note 9{{declared private here}}
+ template <unsigned N> class Base { ~Base(); }; // expected-note 6{{declared private here}}
// expected-error@+1 {{inherited virtual base class 'Base<2>' has private destructor}}
class Base2 : virtual Base<2> { ~Base2(); }; // expected-note 1{{declared private here}}
// expected-error@+1 {{inherited virtual base class 'Base<3>' has private destructor}}
@@ -249,15 +249,13 @@
~Derived2() {}
};
- class Derived3 : // expected-error 3{{has private destructor}}
+ class Derived3 :
Base<0>, // expected-note {{deleted because base class 'Base<0>' has an inaccessible destructor}}
- // expected-note@-1 {{destructor of 'Derived3' is implicitly deleted}}
virtual Base<1>,
Base2,
virtual Base3
{};
- Derived3 d3; // expected-error {{implicitly-deleted default constructor}} expected-error {{use a deleted function}}
- // expected-note@-1 {{implicit destructor for}}
+ Derived3 d3; // expected-error {{implicitly-deleted default constructor}}
#else
#error "missing case of MSVC cross C++ versions"
#endif
Index: clang/test/AST/ast-dump-openmp-begin-declare-variant_namespace_1.cpp
===================================================================
--- clang/test/AST/ast-dump-openmp-begin-declare-variant_namespace_1.cpp
+++ clang/test/AST/ast-dump-openmp-begin-declare-variant_namespace_1.cpp
@@ -134,6 +134,8 @@
// CHECK-NEXT: | | `-UsingDirectiveDecl [[ADDR_65:0x[a-z0-9]*]] <col:3, col:19> col:19 Namespace [[ADDR_0]] 'A'
// CHECK-NEXT: | |-DeclStmt [[ADDR_66:0x[a-z0-9]*]] <line:55:3, col:20>
// CHECK-NEXT: | | `-UsingDirectiveDecl [[ADDR_67:0x[a-z0-9]*]] <col:3, col:19> col:19 Namespace [[ADDR_5]] 'B'
+// CHECK-NEXT: | |-RecoveryExpr {{.*}} <line:57:3, col:7>
+// CHECK-NEXT: | | `-UnresolvedLookupExpr {{.*}} <col:3>
// CHECK-NEXT: | `-ReturnStmt [[ADDR_68:0x[a-z0-9]*]] <line:58:3, col:22>
// CHECK-NEXT: | `-BinaryOperator [[ADDR_69:0x[a-z0-9]*]] <col:10, col:22> 'int' '+'
// CHECK-NEXT: | |-PseudoObjectExpr [[ADDR_70:0x[a-z0-9]*]] <col:10, col:14> 'int'
@@ -159,4 +161,4 @@
// CHECK-NEXT: | `-DeclRefExpr [[ADDR_88:0x[a-z0-9]*]] <col:10> 'int ({{.*}})' {{.*}}Function [[ADDR_42]] 'explicit1' 'int ({{.*}})'
// CHECK-NEXT: `-CallExpr [[ADDR_89:0x[a-z0-9]*]] <col:24, col:34> 'int'
// CHECK-NEXT: `-ImplicitCastExpr [[ADDR_90:0x[a-z0-9]*]] <col:24> 'int (*)({{.*}})' <FunctionToPointerDecay>
-// CHECK-NEXT: `-DeclRefExpr [[ADDR_91:0x[a-z0-9]*]] <col:24> 'int ({{.*}})' {{.*}}Function [[ADDR_62]] 'implicit2' 'int ({{.*}})'
+// CHECK-NEXT: `-DeclRefExpr [[ADDR_91:0x[a-z0-9]*]] <col:24> 'int ({{.*}})' {{.*}}Function [[ADDR_62]] 'implicit2' 'int ({{.*}})'
\ No newline at end of file
Index: clang/lib/Frontend/CompilerInvocation.cpp
===================================================================
--- clang/lib/Frontend/CompilerInvocation.cpp
+++ clang/lib/Frontend/CompilerInvocation.cpp
@@ -2887,9 +2887,9 @@
if (Args.hasArg(OPT_fconcepts_ts))
Diags.Report(diag::warn_fe_concepts_ts_flag);
Opts.RecoveryAST =
- Args.hasFlag(OPT_frecovery_ast, OPT_fno_recovery_ast, false);
+ Args.hasFlag(OPT_frecovery_ast, OPT_fno_recovery_ast, Opts.CPlusPlus);
Opts.RecoveryASTType =
-+ Args.hasFlag(OPT_frecovery_ast_type, OPT_fno_recovery_ast_type, false);
+ Args.hasFlag(OPT_frecovery_ast_type, OPT_fno_recovery_ast_type, false);
Opts.HeinousExtensions = Args.hasArg(OPT_fheinous_gnu_extensions);
Opts.AccessControl = !Args.hasArg(OPT_fno_access_control);
Opts.ElideConstructors = !Args.hasArg(OPT_fno_elide_constructors);
Index: clang/include/clang/Basic/LangOptions.def
===================================================================
--- clang/include/clang/Basic/LangOptions.def
+++ clang/include/clang/Basic/LangOptions.def
@@ -148,7 +148,7 @@
LANGOPT(DoubleSquareBracketAttributes, 1, 0, "'[[]]' attributes extension for all language standard modes")
-COMPATIBLE_LANGOPT(RecoveryAST, 1, 0, "Preserve expressions in AST when encountering errors")
+COMPATIBLE_LANGOPT(RecoveryAST, 1, CPlusPlus, "Preserve expressions in AST when encountering errors")
COMPATIBLE_LANGOPT(RecoveryASTType, 1, 0, "Preserve the type in recovery expressions")
BENIGN_LANGOPT(ThreadsafeStatics , 1, 1, "thread-safe static initializers")
Index: clang-tools-extra/clangd/unittests/CodeCompleteTests.cpp
===================================================================
--- clang-tools-extra/clangd/unittests/CodeCompleteTests.cpp
+++ clang-tools-extra/clangd/unittests/CodeCompleteTests.cpp
@@ -1177,7 +1177,9 @@
int foo(int a, int b, int c);
int main() {
#define ID(X) X
- ID(foo $p^( foo(10), ^ ))
+ // FIXME: figure out why ID(foo (foo(10), )) doesn't work when preserving
+ // the recovery expression.
+ ID(foo $p^( 10, ^ ))
})cpp"};
for (auto Test : Tests) {
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits