llvm / llvm-project

The LLVM Project is a collection of modular and reusable compiler and toolchain technologies.
http://llvm.org
Other
26.77k stars 10.97k forks source link

-fixit-recompile drops warning flags #18707

Open nico opened 10 years ago

nico commented 10 years ago
Bugzilla Link 18333
Version unspecified
OS All
CC @akyrtzi,@steveire

Extended Description

This program compiles fine normally, but has compilation errors with -fixit-recompile:

hummer:clang thakis$ cat test.cc

include

struct A { void f() {} };

void f() { A* a; a->f();

register int data; } hummer:clang thakis$ ../../Release+Asserts/bin/clang -c test.cc -Wno-deprecated-register -std=c++11 -Werror hummer:clang thakis$ ../../Release+Asserts/bin/clang -c test.cc -Xclang -fixit-recompile -Wno-deprecated-register -std=c++11 -Werror test.cc:9:3: error: 'register' storage class specifier is deprecated [-Werror,-Wdeprecated-register] register int data; ^~~~~ 1 error generated.

steveire commented 5 years ago

I just hit the same thing with

#define MY_DEPRECATED(replacement) __declspec(deprecated("Use " ## replacement ## " instead"))

struct MY_DEPRECATED("Bar") Foo
{
};

and -Wno-invalid-token-paste being ignored.

Any idea what is wrong here?

nico commented 10 years ago

(memory.h include is unnecessary)