aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/clang/Basic/Attr.td5
-rw-r--r--include/clang/Basic/DiagnosticSemaKinds.td3
-rw-r--r--include/clang/Sema/AttributeList.h1
3 files changed, 9 insertions, 0 deletions
diff --git a/include/clang/Basic/Attr.td b/include/clang/Basic/Attr.td
index 9b0982a29b..010736112d 100644
--- a/include/clang/Basic/Attr.td
+++ b/include/clang/Basic/Attr.td
@@ -232,6 +232,11 @@ def Final : InheritableAttr {
let Spellings = [];
}
+def ForbidTemporaries : Attr {
+ let Spellings = ["forbid_temporaries"];
+ let Subjects = [CXXRecord];
+}
+
def Format : InheritableAttr {
let Spellings = ["format"];
let Args = [StringArgument<"Type">, IntArgument<"FormatIdx">,
diff --git a/include/clang/Basic/DiagnosticSemaKinds.td b/include/clang/Basic/DiagnosticSemaKinds.td
index b18294eb3f..f33285c7d4 100644
--- a/include/clang/Basic/DiagnosticSemaKinds.td
+++ b/include/clang/Basic/DiagnosticSemaKinds.td
@@ -856,6 +856,9 @@ def err_temp_copy_deleted : Error<
"of type %1 invokes deleted constructor">;
def err_temp_copy_incomplete : Error<
"copying a temporary object of incomplete type %0">;
+def warn_temporaries_forbidden : Warning<
+ "must not create temporaries of type %0">,
+ InGroup<DiagGroup<"forbid-temporaries">>;
// C++0x decltype
def err_cannot_determine_declared_type_of_overloaded_function : Error<
diff --git a/include/clang/Sema/AttributeList.h b/include/clang/Sema/AttributeList.h
index 91389a4d98..7ed6ffcdaf 100644
--- a/include/clang/Sema/AttributeList.h
+++ b/include/clang/Sema/AttributeList.h
@@ -104,6 +104,7 @@ public:
AT_dllimport,
AT_ext_vector_type,
AT_fastcall,
+ AT_forbid_temporaries,
AT_format,
AT_format_arg,
AT_global,