[LLVMbugs] [Bug 19742] New: clang allows forming pointer to function with cv-qualifier-seq or ref-qualifier
bugzilla-daemon at llvm.org
bugzilla-daemon at llvm.org
Wed May 14 11:24:25 PDT 2014
http://llvm.org/bugs/show_bug.cgi?id=19742
Bug ID: 19742
Summary: clang allows forming pointer to function with
cv-qualifier-seq or ref-qualifier
Product: clang
Version: trunk
Hardware: PC
OS: Linux
Status: NEW
Severity: normal
Priority: P
Component: C++11
Assignee: unassignedclangbugs at nondot.org
Reporter: daniel.kruegler at gmail.com
CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
Classification: Unclassified
When compiling the following code using C++11 options:
-Wall -Wextra -std=c++11 -pedantic
or using C++1y options:
-Wall -Wextra -std=c++1y -pedantic
it is accepted by clang 3.5 trunk 208701 or 3.4 final:
//---------------------
template<class T>
struct add_ptr
{
using type = T*;
};
int main() {
using FC = void () const;
using PFC = add_ptr<FC>::type;
using FLR = void () &;
using PFLR = add_ptr<FLR>::type;
using FRR = void () &&;
using PFRR = add_ptr<FRR>::type;
}
//---------------------
After resolution of CWG 1417,
http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#1417
the formation of a pointer to function types with cv-qualifier or ref-qualifier
(even in template context) is not supported. In non-template context, clang
already rejects such an attempt.
The code had been compiled using the online-compiler
http://melpon.org/wandbox/
therefore the provided information about OS and hardware are guesses on my
side.
--
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/20140514/48555323/attachment.html>
More information about the llvm-bugs
mailing list