mirror of
https://github.com/Gericom/teak-llvm.git
synced 2025-06-25 14:28:54 -04:00

starting with an underscore is ill-formed. Since this rule rejects programs that were using <inttypes.h>'s macros, recover from this error by treating the ud-suffix as a separate preprocessing-token, with a DefaultError ExtWarn. The approach of treating such cases as two tokens is under discussion for standardization, but is in any case a conforming extension and allows existing codebases to keep building while the committee makes up its mind. Reword the warning on the definition of literal operators not starting with underscores (which are, strangely, legal) to more explicitly state that such operators can't be called by literals. Remove the special-case diagnostic for hexfloats, since it was both triggering in the wrong cases and incorrect. llvm-svn: 152287
12 lines
564 B
C++
12 lines
564 B
C++
// RUN: %clang_cc1 -Wc++11-compat -verify -std=c++98 %s
|
|
// RUN: cp %s %t
|
|
// RUN: not %clang_cc1 -Wc++11-compat -Werror -x c++ -std=c++98 -fixit %t
|
|
// RUN: %clang_cc1 -Wall -pedantic-errors -Wc++11-compat -Werror -x c++ -std=c++98 %t
|
|
|
|
// This is a test of the code modification hints for C++11-compatibility problems.
|
|
|
|
#define bar "bar"
|
|
const char *p = "foo"bar; // expected-warning {{will be treated as a reserved user-defined literal suffix}}
|
|
#define _bar "_bar"
|
|
const char *q = "foo"_bar; // expected-warning {{will be treated as a user-defined literal suffix}}
|