llvm-project/clang/test/SemaCXX/no-warn-user-defined-literals-in-system-headers.cpp
Erich Keane c8554e13ee
Turn -Wdeprecated-literal-operator on by default (#111027)
It would be nice to see what our users think about this change, as this
is something that WG21/EWG quite wants to fix a handful of questionable
issues with UB. Depending on the outcome of this after being committed,
we might instead suggest EWG undeprecate this, and require a bit of
'magic' from the lexer.

Additionally, this patch makes it so we emit this diagnostic ALSO in
cases where the literal name is reserved. It doesn't make sense to limit
that.

---------

Co-authored-by: Vlad Serebrennikov <serebrennikov.vladislav@gmail.com>
2024-10-11 06:10:03 -07:00

6 lines
253 B
C++

// RUN: %clang_cc1 -fsyntax-only -verify -std=c++11 -isystem %S %s
#include <no-warn-user-defined-literals-in-system-headers.h>
void operator "" bar(long double); // expected-warning{{user-defined literal suffixes not starting with '_' are reserved}}