rsmith accepted this revision.
This revision is now accepted and ready to land.

================
Comment at: lib/AST/Decl.cpp:2938-2948
@@ -2937,1 +2937,13 @@
 
+SourceRange FunctionDecl::getExceptionSpecSourceRange() const {
+  const TypeSourceInfo *TSI = getTypeSourceInfo();
+  if (!TSI)
+    return SourceRange();
+  FunctionTypeLoc FTL =
+    TSI->getTypeLoc().IgnoreParens().getAs<FunctionTypeLoc>();
+  if (!FTL)
+    return SourceRange();
+
+  return FTL.getExceptionSpecRange();
+}
+
----------------
Can you factor out a function to get the `FunctionTypeLoc` from a 
`FunctionDecl`, when there is one (preferably as a separate change)? This is 
duplicated in a few places now (you can find some more by searching for 
`getAs<FunctionProtoTypeLoc>` in Sema), and looks slightly wrong here (we 
should skip calling convention attributes as well as parens).


http://reviews.llvm.org/D20428



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to