http://llvm.org/bugs/show_bug.cgi?id=12701
Bug #: 12701
Summary: Support unqualified base lookup in microsoft mode in
template functions of template classes
Product: clang
Version: unspecified
Platform: PC
OS/Version: Windows NT
Status: NEW
Severity: enhancement
Priority: P
Component: C++
AssignedTo: [email protected]
ReportedBy: [email protected]
CC: [email protected], [email protected]
Classification: Unclassified
cl.exe accepts this program. clang doesn't:
class A {};
class B {};
template <class T>
class Base {
public:
bool base_fun(void* p) { return false; }
operator T*() const { return 0; }
};
template <class T>
class Container : public Base<T> {
public:
template <typename S>
bool operator=(const Container<S>& rhs) {
return base_fun(rhs);
}
};
void f() {
Container<A> text_provider;
Container<B> text_provider2;
text_provider2 = text_provider;
}
C:\src\chrome\src>cl /c test.cc
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 16.00.30319.01 for 80x86
Copyright (C) Microsoft Corporation. All rights reserved.
test.cc
C:\src\chrome\src>..\..\llvm-build\bin\Release\clang.exe -c test.cc
test.cc:16:12: error: use of undeclared identifier 'base_fun'
return base_fun(rhs);
^
test.cc:23:18: note: in instantiation of function template specialization
'Container<B>::operator=<A>' requested here
text_provider2 = text_provider;
^
test.cc:7:8: note: must qualify identifier to find this declaration in
dependent base class
bool base_fun(void* p) { return false; }
^
1 error generated.
It looks like the function that prints this is Sema::DiagnoseEmptyLookup in
SemaExpr.cpp. It looks like it permits similar constructs in other places in
microsoft mode already.
This is necessary to parse atlcomcli.h
--
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs