diff options
| author | Francois Pichet <pichet2000@gmail.com> | 2011-09-07 00:14:57 +0000 |
|---|---|---|
| committer | Francois Pichet <pichet2000@gmail.com> | 2011-09-07 00:14:57 +0000 |
| commit | bcf6471010a1c3376cfc938f6ccc1e364fc07d1d (patch) | |
| tree | f39856ffbdec6842d38b5f89c3c7282b4b61b103 /clang/test | |
| parent | 9d814e0dd255d567d9d8349122bab25e1153cde4 (diff) | |
| download | bcm5719-llvm-bcf6471010a1c3376cfc938f6ccc1e364fc07d1d.tar.gz bcm5719-llvm-bcf6471010a1c3376cfc938f6ccc1e364fc07d1d.zip | |
In Microsoft mode, if we are inside a template class member function and we can't resolve a function call then create a type-dependent CallExpr even if the function has no type dependent arguments. The goal is to postpone name lookup to instantiation time to be able to search into type dependent base classes.
With this patch in, clang will generate only 37 errors (down from 212) when parsing a typical MFC source file.
llvm-svn: 139210
Diffstat (limited to 'clang/test')
| -rw-r--r-- | clang/test/SemaTemplate/ms-lookup-template-base-classes.cpp | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/clang/test/SemaTemplate/ms-lookup-template-base-classes.cpp b/clang/test/SemaTemplate/ms-lookup-template-base-classes.cpp new file mode 100644 index 00000000000..910fa37e80d --- /dev/null +++ b/clang/test/SemaTemplate/ms-lookup-template-base-classes.cpp @@ -0,0 +1,31 @@ +// RUN: %clang_cc1 -fms-extensions -fsyntax-only -verify %s + + +template <class T> +class A { +public: + void f(T a) { }// expected-note {{must qualify identifier to find this declaration in dependent base class}} + void g();// expected-note {{must qualify identifier to find this declaration in dependent base class}} +}; + + +template <class T> +class B : public A<T> { +public: + void z(T a) + { + f(a); // expected-warning {{use of identifier 'f' found via unqualified lookup into dependent bases of class templates is a Microsoft extension}} + g(); // expected-warning {{use of identifier 'g' found via unqualified lookup into dependent bases of class templates is a Microsoft extension}} + } +}; + +template class B<int>; // expected-note {{requested here}} +template class B<char>; + +void test() +{ + B<int> b; + b.z(3); +} + + |

