When we substitute into the type of a function based on the
TypeSourceInfo, we may have lost some adjustments made to the type of
that function due to declaration merging. Adjust the resulting type
correspondingly. Fixes PR12948 / <rdar://problem/11552434>.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163845 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/SemaCXX/attr-noreturn.cpp b/test/SemaCXX/attr-noreturn.cpp
index eaf0d0c..f3d548b 100644
--- a/test/SemaCXX/attr-noreturn.cpp
+++ b/test/SemaCXX/attr-noreturn.cpp
@@ -54,3 +54,29 @@
int xpto::blah() {
return 3; // expected-warning {{function 'blah' declared 'noreturn' should not return}}
}
+
+// PR12948
+
+namespace PR12948 {
+ template<int>
+ void foo() __attribute__((__noreturn__));
+
+ template<int>
+ void foo() {
+ while (1) continue;
+ }
+
+ void bar() __attribute__((__noreturn__));
+
+ void bar() {
+ foo<0>();
+ }
+
+
+ void baz() __attribute__((__noreturn__));
+ typedef void voidfn();
+ voidfn baz;
+
+ template<typename> void wibble() __attribute__((__noreturn__));
+ template<typename> voidfn wibble;
+}