diff options
Diffstat (limited to 'clang/test')
-rw-r--r-- | clang/test/CXX/dcl.dcl/dcl.spec/dcl.type/dcl.spec.auto/p6.cpp | 6 | ||||
-rw-r--r-- | clang/test/SemaCXX/cxx0x-initializer-stdinitializerlist.cpp | 5 | ||||
-rw-r--r-- | clang/test/SemaObjCXX/properties.mm | 2 |
3 files changed, 9 insertions, 4 deletions
diff --git a/clang/test/CXX/dcl.dcl/dcl.spec/dcl.type/dcl.spec.auto/p6.cpp b/clang/test/CXX/dcl.dcl/dcl.spec/dcl.type/dcl.spec.auto/p6.cpp index aa22b8f56bb..d327efcc20d 100644 --- a/clang/test/CXX/dcl.dcl/dcl.spec/dcl.type/dcl.spec.auto/p6.cpp +++ b/clang/test/CXX/dcl.dcl/dcl.spec/dcl.type/dcl.spec.auto/p6.cpp @@ -92,8 +92,7 @@ namespace PR10939 { template<typename T> T g(T); void f(X *x) { - // FIXME: we should really only get the first diagnostic here. - auto value = x->method; // expected-error {{reference to non-static member function must be called}} expected-error{{variable 'value' with type 'auto' has incompatible initializer of type '<bound member function type>'}} + auto value = x->method; // expected-error {{reference to non-static member function must be called}} if (value) { } auto funcptr = &g<int>; @@ -101,4 +100,5 @@ namespace PR10939 { } } -// TODO: if the initializer is a braced-init-list, deduce auto as std::initializer_list<T>. +// if the initializer is a braced-init-list, deduce auto as std::initializer_list<T>: +// see SemaCXX/cxx0x-initializer-stdinitializerlist.cpp diff --git a/clang/test/SemaCXX/cxx0x-initializer-stdinitializerlist.cpp b/clang/test/SemaCXX/cxx0x-initializer-stdinitializerlist.cpp index 47ceaf0b83c..fe3cd8fc3a1 100644 --- a/clang/test/SemaCXX/cxx0x-initializer-stdinitializerlist.cpp +++ b/clang/test/SemaCXX/cxx0x-initializer-stdinitializerlist.cpp @@ -1,5 +1,10 @@ // RUN: %clang_cc1 -std=c++11 -fsyntax-only -verify %s +// This must obviously come before the definition of std::initializer_list. +void missing_initializerlist() { + auto l = {1, 2, 3, 4}; // expected-error {{std::initializer_list was not found}} +} + namespace std { typedef decltype(sizeof(int)) size_t; diff --git a/clang/test/SemaObjCXX/properties.mm b/clang/test/SemaObjCXX/properties.mm index d8d92e56879..ac780c023bf 100644 --- a/clang/test/SemaObjCXX/properties.mm +++ b/clang/test/SemaObjCXX/properties.mm @@ -28,7 +28,7 @@ struct X { - (int) z; @end void test2(Test2 *a) { - auto y = a.y; // expected-error {{expected getter method not found on object of type 'Test2 *'}} expected-error {{variable 'y' with type 'auto' has incompatible initializer of type}} + auto y = a.y; // expected-error {{expected getter method not found on object of type 'Test2 *'}} auto z = a.z; } |