[LLVMbugs] [Bug 23254] New: Nested name specifier refers to injected class name, not the constructor
bugzilla-daemon at llvm.org
bugzilla-daemon at llvm.org
Thu Apr 16 12:38:32 PDT 2015
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: unassignedclangbugs at nondot.org
Reporter: mjbshaw at hotmail.com
CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20150416/293bd4ba/attachment.html>
More information about the llvm-bugs
mailing list