]> granicus.if.org Git - clang/commitdiff
Use getCustomDiagID() instead of specifying the diagnostic in the 'DiagnosticKinds...
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>
Mon, 6 Oct 2008 23:16:35 +0000 (23:16 +0000)
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>
Mon, 6 Oct 2008 23:16:35 +0000 (23:16 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57220 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/Basic/DiagnosticKinds.def
lib/Sema/SemaExprCXX.cpp

index 87b2baa254479c5de286ae66a03b45d3a7a2aa12..4e4a42f7ae87db89ee81d4281e547e6963182382 100644 (file)
@@ -1022,9 +1022,6 @@ DIAG(err_builtin_direct_init_more_than_one_arg, ERROR,
      "initializer of a builtin type can only take one argument")
 DIAG(err_value_init_for_array_type, ERROR,
      "array types cannot be value-initialized")
-// Temporary
-DIAG(err_unsupported_class_constructor, ERROR,
-     "class constructors are not supported yet")
 DIAG(err_invalid_use_of_function_type, ERROR,
      "a function type is not allowed here")
 DIAG(err_invalid_use_of_array_type, ERROR,
index c8a21f7d53f58e0d701c80351cf02599de8d0306..540d92dbae27e004bd12db40c6a267db2445c6fc 100644 (file)
@@ -15,6 +15,7 @@
 #include "clang/AST/ExprCXX.h"
 #include "clang/AST/ASTContext.h"
 #include "clang/Parse/DeclSpec.h"
+#include "clang/Lex/Preprocessor.h"
 #include "clang/Basic/Diagnostic.h"
 using namespace clang;
 
@@ -95,8 +96,9 @@ Sema::ActOnCXXTypeConstructExpr(SourceRange TypeRange, TypeTy *TypeRep,
       return Diag(TyBeginLoc, diag::err_invalid_incomplete_type_use,
                   Ty.getAsString(), FullRange);
 
-    // "class constructors are not supported yet"
-    return Diag(TyBeginLoc, diag::err_unsupported_class_constructor, FullRange);
+    unsigned DiagID = PP.getDiagnostics().getCustomDiagID(Diagnostic::Error,
+                                    "class constructors are not supported yet");
+    return Diag(TyBeginLoc, DiagID);
   }
 
   // C++ 5.2.3p1: