DescriptionThis patch implements as much of the narrowing conversion error specified by [dcl.init.list] as is possible without generalized initializer lists or full constant expression support, and emits a c++0x-compat warning in C++98 mode.
I haven't done much with this code before, so let me know if there are better ways to do pieces of this, or if I've attached the logic in completely the wrong place.
The FixIt currently uses a typedef's basename without qualification, which is likely to be incorrect on some code. I'm not sure I'll need anything more correct to clean up Google's codebase, but if you want me to fix it up I'd like to do that in a separate change.
The "has the same value after a round-trip through another type" logic is messier than I'd like, but cleaning it up appears to need more methods on types like APInt and APFloat, which I'd like to postpone until another change too. If I'm just missing existing facilities, please point them out.
The warning is currently off by default. I'll fix LLVM and clang before turning it on.
Patch Set 1 #Patch Set 2 : Fix the tests #Patch Set 3 : Refactor #Patch Set 4 : Use new APFloat API #Patch Set 5 : Use the DiagnosticBuilder<<APValue operator from issue 4749047 #Patch Set 6 : Sync #Patch Set 7 : Split out c++0x-compat warning and fix TypedefTypes #Patch Set 8 : Sync #
Total comments: 8
Patch Set 9 : Fix Sean's review comments. #Patch Set 10 : Sync #
MessagesTotal messages: 5
|