[llvm-bugs] [Bug 40732] New: Wrong result of TypeName::getFullyQualifiedName(...) for member pointer types with WithGlobalNsPrefix=true
via llvm-bugs
llvm-bugs at lists.llvm.org
Thu Feb 14 13:48:03 PST 2019
https://bugs.llvm.org/show_bug.cgi?id=40732
Bug ID: 40732
Summary: Wrong result of TypeName::getFullyQualifiedName(...)
for member pointer types with WithGlobalNsPrefix=true
Product: clang
Version: trunk
Hardware: PC
OS: Linux
Status: NEW
Severity: normal
Priority: P
Component: -New Bugs
Assignee: unassignedclangbugs at nondot.org
Reporter: simon.schroeder at tu-dortmund.de
CC: htmldeveloper at gmail.com, llvm-bugs at lists.llvm.org,
neeilans at live.com, richard-llvm at metafoo.co.uk
Hi,
Description:
If a pointer to member type (MemberPointerType) is passed to
TypeName::getFullyQualifiedName(...) with WithGlobalNsPrefix set to true, the
resulting type string will not contain the global namespace specifier ("::").
More precisely, the global namespace specifier is missing for the member's type
as well as for the class' type. Thus, WithGlobalNsPrefix=true does not work for
pointer to member types.
Example:
Consider the following code:
namespace N {
class C {
public:
int m1;
C* m2;
};
void f() {
int C::*mp1;
C* C::*mp2;
}
}
int main() {
N::f();
}
Now, when looking at the variables' types:
mp1's type:
Expected (fully qualified type string with global namespace specifier):
int ::N::C::*
getFullyQualifiedName's result:
int N::C::*
mp2's type:
Expected (fully qualified type string with global namespace specifier):
::N::C *::N::C::*
getFullyQualifiedName's result:
N::C *N::C::*
--
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20190214/03cca819/attachment.html>
More information about the llvm-bugs
mailing list