https://llvm.org/bugs/show_bug.cgi?id=23254
Bug ID: 23254
Summary: Nested name specifier refers to injected class name,
not the constructor
Product: clang
Version: 3.6
Hardware: All
OS: All
Status: NEW
Severity: normal
Priority: P
Component: C++11
Assignee: [email protected]
Reporter: [email protected]
CC: [email protected], [email protected]
Classification: Unclassified
>From the StackOverflow question: http://stackoverflow.com/q/29681449/1287251
The code:
#include <iostream>
struct B
{
};
struct C
{
C (){ std::cout << "C" << '\n'; }
C (B *) { std::cout << "C (B *)" << '\n';}
};
B *y = nullptr;
int main()
{
C::C (y);
}
compiles with clang 3.5 and 3.6 and prints "C". This should not be valid code,
though, as C::C should refer to the constructor (and not the inject class name
C).
--
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