This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/61057] [C++11] operator . considered part of User Defined Literal invocation.
- From: "redi at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sun, 04 May 2014 20:25:08 +0000
- Subject: [Bug c++/61057] [C++11] operator . considered part of User Defined Literal invocation.
- Auto-submitted: auto-generated
- References: <bug-61057-4 at http dot gcc dot gnu dot org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=61057
Jonathan Wakely <redi at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |emsr at gcc dot gnu.org
--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Reduced:
class Int {
public:
constexpr Int(long long unsigned value)
: m_value(value)
{}
const long long unsigned m_value;
};
constexpr Int operator "" _i(long long unsigned i) {
return Int(i);
}
auto x = 1_i.m_value;
I think G++ is correct, the grammar in the standard defines 1_i.m_value as a
pp-number, i.e. a single preprocessing token, which is treated as a literal, so
_i.m_value is looked up as the suffix.
Clang gives the same error.