[cfe-commits] r153129 - in /cfe/trunk: lib/Parse/ParseCXXInlineMethods.cpp test/SemaCXX/cxx98-compat.cpp
Sebastian Redl
sebastian.redl at getdesigned.at
Tue Mar 20 14:24:04 PDT 2012
Author: cornedbee
Date: Tue Mar 20 16:24:03 2012
New Revision: 153129
URL: http://llvm.org/viewvc/llvm-project?rev=153129&view=rev
Log:
Fix the other place where C++98 work for initializer lists was necessary.
Modified:
cfe/trunk/lib/Parse/ParseCXXInlineMethods.cpp
cfe/trunk/test/SemaCXX/cxx98-compat.cpp
Modified: cfe/trunk/lib/Parse/ParseCXXInlineMethods.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/ParseCXXInlineMethods.cpp?rev=153129&r1=153128&r2=153129&view=diff
==============================================================================
--- cfe/trunk/lib/Parse/ParseCXXInlineMethods.cpp (original)
+++ cfe/trunk/lib/Parse/ParseCXXInlineMethods.cpp Tue Mar 20 16:24:03 2012
@@ -320,9 +320,10 @@
LM.DefaultArgs[I].Param);
ExprResult DefArgResult;
- if (Tok.is(tok::l_brace))
+ if (getLangOpts().CPlusPlus0x && Tok.is(tok::l_brace)) {
+ Diag(Tok, diag::warn_cxx98_compat_generalized_initializer_lists);
DefArgResult = ParseBraceInitializer();
- else
+ } else
DefArgResult = ParseAssignmentExpression();
if (DefArgResult.isInvalid())
Actions.ActOnParamDefaultArgumentError(LM.DefaultArgs[I].Param);
Modified: cfe/trunk/test/SemaCXX/cxx98-compat.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/cxx98-compat.cpp?rev=153129&r1=153128&r2=153129&view=diff
==============================================================================
--- cfe/trunk/test/SemaCXX/cxx98-compat.cpp (original)
+++ cfe/trunk/test/SemaCXX/cxx98-compat.cpp Tue Mar 20 16:24:03 2012
@@ -50,6 +50,10 @@
s = {}; // expected-warning {{generalized initializer lists are incompatible with C++98}}
return { 0 }; // expected-warning {{generalized initializer lists are incompatible with C++98}}
}
+struct DelayedDefaultArgumentParseInitList {
+ void f(int i = {1}) { // expected-warning {{generalized initializer lists are incompatible with C++98}}
+ }
+};
int operator"" _hello(const char *); // expected-warning {{literal operators are incompatible with C++98}}
More information about the cfe-commits
mailing list