[cfe-commits] r79964 - /cfe/trunk/lib/Sema/SemaDeclCXX.cpp
Anders Carlsson
andersca at mac.com
Mon Aug 24 18:02:06 PDT 2009
Author: andersca
Date: Mon Aug 24 20:02:06 2009
New Revision: 79964
URL: http://llvm.org/viewvc/llvm-project?rev=79964&view=rev
Log:
Check that the default argument is well-formed before checking the initializer types.
Modified:
cfe/trunk/lib/Sema/SemaDeclCXX.cpp
Modified: cfe/trunk/lib/Sema/SemaDeclCXX.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDeclCXX.cpp?rev=79964&r1=79963&r2=79964&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaDeclCXX.cpp (original)
+++ cfe/trunk/lib/Sema/SemaDeclCXX.cpp Mon Aug 24 20:02:06 2009
@@ -124,6 +124,13 @@
return;
}
+ // Check that the default argument is well-formed
+ CheckDefaultArgumentVisitor DefaultArgChecker(DefaultArg.get(), this);
+ if (DefaultArgChecker.Visit(DefaultArg.get())) {
+ Param->setInvalidDecl();
+ return;
+ }
+
// C++ [dcl.fct.default]p5
// A default argument expression is implicitly converted (clause
// 4) to the parameter type. The default argument expression has
@@ -143,13 +150,6 @@
return;
}
- // Check that the default argument is well-formed
- CheckDefaultArgumentVisitor DefaultArgChecker(DefaultArg.get(), this);
- if (DefaultArgChecker.Visit(DefaultArg.get())) {
- Param->setInvalidDecl();
- return;
- }
-
DefaultArgPtr = MaybeCreateCXXExprWithTemporaries(DefaultArg.take(),
/*DestroyTemps=*/false);
More information about the cfe-commits
mailing list