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: [email protected]
Reporter: [email protected]
CC: [email protected], [email protected]
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.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs