[PATCH] Delay lookup of simple default template arguments under -fms-compatibility
David Majnemer
david.majnemer at gmail.com
Mon Jun 2 16:01:22 PDT 2014
================
Comment at: lib/Parse/ParseDecl.cpp:2764
@@ +2763,3 @@
+ getCurScope()->isTemplateParamScope() &&
+ DSContext == DSC_template_type_arg) {
+ TypeRep = Actions.ActOnDelayedDefaultTemplateArg(
----------------
Perhaps move the `DSContext == DSC_template_type_arg` check before the calls to `getLangOpts()` ? It should be a little cheaper.
================
Comment at: lib/Sema/SemaDecl.cpp:358
@@ +357,3 @@
+ return NestedNameSpecifier::Create(Context, SubNNS, ND);
+ else if (CXXRecordDecl *RD = dyn_cast<CXXRecordDecl>(DC))
+ return NestedNameSpecifier::Create(Context, SubNNS, RD->isTemplateDecl(),
----------------
Perhaps `auto RD = dyn_cast<CXXRecordDecl(DC))` ?
================
Comment at: lib/Sema/SemaDecl.cpp:366
@@ +365,3 @@
+ SourceLocation NameLoc) {
+ Diag(NameLoc, diag::ext_ms_delayed_template_argument) << &II;
+
----------------
Perhaps a comment as to why we are emitting this diagnostic?
http://reviews.llvm.org/D3995
More information about the cfe-commits
mailing list