r239954 - [modules] Fix typo in default argument merging.
Richard Smith
richard-llvm at metafoo.co.uk
Wed Jun 17 15:13:24 PDT 2015
Author: rsmith
Date: Wed Jun 17 17:13:23 2015
New Revision: 239954
URL: http://llvm.org/viewvc/llvm-project?rev=239954&view=rev
Log:
[modules] Fix typo in default argument merging.
Modified:
cfe/trunk/lib/Serialization/ASTReaderDecl.cpp
cfe/trunk/test/Modules/Inputs/submodules-merge-defs/defs.h
cfe/trunk/test/Modules/Inputs/template-default-args/c.h
cfe/trunk/test/Modules/submodules-merge-defs.cpp
cfe/trunk/test/Modules/template-default-args.cpp
Modified: cfe/trunk/lib/Serialization/ASTReaderDecl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Serialization/ASTReaderDecl.cpp?rev=239954&r1=239953&r2=239954&view=diff
==============================================================================
--- cfe/trunk/lib/Serialization/ASTReaderDecl.cpp (original)
+++ cfe/trunk/lib/Serialization/ASTReaderDecl.cpp Wed Jun 17 17:13:23 2015
@@ -2924,13 +2924,13 @@ static void inheritDefaultTemplateArgume
NamedDecl *ToParam = ToTP->getParam(N - I - 1);
if (auto *FTTP = dyn_cast<TemplateTypeParmDecl>(FromParam)) {
- if (inheritDefaultTemplateArgument(Context, FTTP, ToParam))
+ if (!inheritDefaultTemplateArgument(Context, FTTP, ToParam))
break;
} else if (auto *FNTTP = dyn_cast<NonTypeTemplateParmDecl>(FromParam)) {
- if (inheritDefaultTemplateArgument(Context, FNTTP, ToParam))
+ if (!inheritDefaultTemplateArgument(Context, FNTTP, ToParam))
break;
} else {
- if (inheritDefaultTemplateArgument(
+ if (!inheritDefaultTemplateArgument(
Context, cast<TemplateTemplateParmDecl>(FromParam), ToParam))
break;
}
Modified: cfe/trunk/test/Modules/Inputs/submodules-merge-defs/defs.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Modules/Inputs/submodules-merge-defs/defs.h?rev=239954&r1=239953&r2=239954&view=diff
==============================================================================
--- cfe/trunk/test/Modules/Inputs/submodules-merge-defs/defs.h (original)
+++ cfe/trunk/test/Modules/Inputs/submodules-merge-defs/defs.h Wed Jun 17 17:13:23 2015
@@ -66,9 +66,11 @@ namespace FriendDefArg {
template<typename = int> struct A;
template<int = 0> struct B;
template<template<typename> class = A> struct C;
+ template<typename = int, int = 0, template<typename> class = A> struct D {};
template<typename U> struct Y {
template<typename> friend struct A;
template<int> friend struct B;
template<template<typename> class> friend struct C;
+ template<typename, int, template<typename> class> friend struct D;
};
}
Modified: cfe/trunk/test/Modules/Inputs/template-default-args/c.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Modules/Inputs/template-default-args/c.h?rev=239954&r1=239953&r2=239954&view=diff
==============================================================================
--- cfe/trunk/test/Modules/Inputs/template-default-args/c.h (original)
+++ cfe/trunk/test/Modules/Inputs/template-default-args/c.h Wed Jun 17 17:13:23 2015
@@ -1 +1,2 @@
template<typename T = int> struct F;
+template<typename T, typename U> struct I;
Modified: cfe/trunk/test/Modules/submodules-merge-defs.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Modules/submodules-merge-defs.cpp?rev=239954&r1=239953&r2=239954&view=diff
==============================================================================
--- cfe/trunk/test/Modules/submodules-merge-defs.cpp (original)
+++ cfe/trunk/test/Modules/submodules-merge-defs.cpp Wed Jun 17 17:13:23 2015
@@ -82,3 +82,4 @@ J<> post_j;
template<typename T, int N, template<typename> class K> struct J;
J<> post_j2;
FriendDefArg::Y<int> friend_def_arg;
+FriendDefArg::D<> friend_def_arg_d;
Modified: cfe/trunk/test/Modules/template-default-args.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Modules/template-default-args.cpp?rev=239954&r1=239953&r2=239954&view=diff
==============================================================================
--- cfe/trunk/test/Modules/template-default-args.cpp (original)
+++ cfe/trunk/test/Modules/template-default-args.cpp Wed Jun 17 17:13:23 2015
@@ -7,6 +7,7 @@ template<typename T> struct C;
template<typename T = int> struct D;
template<typename T = int> struct E {};
template<typename T> struct H {};
+template<typename T = int, typename U = int> struct I {};
#include "b.h"
@@ -30,3 +31,4 @@ G<> g; // expected-error {{default argum
// expected-note at a.h:6 {{default argument declared here}}
H<> h; // expected-error {{default argument of 'H' must be imported from module 'X.A' before it is required}}
// expected-note at a.h:7 {{default argument declared here}}
+I<> i;
More information about the cfe-commits
mailing list