If a warning is generated when using the reserved identifier when using the command?

When using string

using std::literals::chrono_literals::operator""s; 

in g ++ 6.3.0, the compiler generates a warning:

warning: operator literal suffixes that are not preceded by '_' are reserved for future standardization

 using std::literals::chrono_literals::operator""s; 

A similar warning is also issued in MSVS. However, clang 3.8.0 does not raise such a warning.

Since operator""s is defined by the standard for the chrono library, this should not cause a warning, since we just import the name and not define it?

+7
c ++ language-lawyer reserved-words using-directives user-defined-literals
source share
1 answer

Perhaps the wording is clear enough in this question [over.literal] / 1 :

Some literal suffix identifiers are reserved for future standardization; see 17.6.4.3.5. An ad where literal-operator-id uses such a letter suffix identifier is poorly formed; no diagnostics required.

This can be interpreted as a call to operators (UDL operator), whose "name" is a literal identifier operator & mdash, which, of course, excludes your business, since literal identifiers-operators are unqualified. The same goes for [reserved.names] / 2 , where the “context” are declarations of user literals.

+2
source share